leetcode977
public class Solution {
public int[] SortedSquares(int[] A) {
return A.Select(x => x * x).ToList().OrderBy(x => x).ToArray();
}
}
leetcode977的更多相关文章
- leetcode-977. 有序数组的平方
leetcode-977. 有序数组的平方 (来自 120周赛) 题意 给定一个按非递减顺序排序的整数数组 A,返回每个数字的平方组成的新数组,要求也按非递减顺序排序. 示例 1: 输入:[-4,-1 ...
- [Swift]LeetCode977. 有序数组的平方 | Squares of a Sorted Array
Given an array of integers A sorted in non-decreasing order, return an array of the squares of each ...
- LeetCode977. 有序数组的平方
问题:977. 有序数组的平方 给定一个按非递减顺序排序的整数数组 A,返回每个数字的平方组成的新数组,要求也按非递减顺序排序. 示例 1: 输入:[-4,-1,0,3,10] 输出:[0,1,9,1 ...
- LeetCode977.Squares of a Sorted Array
题目 977. Squares of a Sorted Array Given an array of integers A sorted in non-decreasing order, retur ...
- LeetCode通关:数组十七连,真是不简单
分门别类刷算法,坚持,进步! 刷题路线参考:https://github.com/chefyuan/algorithm-base https://github.com/youngyangy ...
随机推荐
- 给div加滚动条
<div style="width:175px;height:100px;background:white;overflow:scroll;"> <span> ...
- CentOS升级Python2.6到Python2.7并安装pip
原文:http://ruter.sundaystart.net/2015/12/03/Update-python/ 貌似CentOS 6.X系统默认安装的Python都是2.6版本的?平时使用以及很多 ...
- PHP独立环境搭建细节
一.安装前准备: 准备安装软件此处以以下软件为例: Appache:httpd-2.2.21-win32-x86-openssl-0.9.8r.msi MySQL: mysql-5.5.21-win ...
- C#中DateTime的缺陷 ---- 代替品DateTimeOffset
C#中的DateTime在逻辑上有个非常严重的缺陷: > var d = DateTime.Now; > var d2 = d.ToUniversalTime(); > d == d ...
- div+css 怎么让一个小div在另一个大div里面 垂直居中
div+css 怎么让一个小div在另一个大div里面 垂直居中 方法1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 .parent { width:800 ...
- C51 头文件中的 extern
C51 头文件使用 extern 的目的是声明外部变量或函数. 使用注意: 只放在 .h 文件中. 声明时不用赋值. extern 只是声明不是定义.
- java 多线程知识点
线程状态图 说明: 线程共包括以下5种状态. 新建状态(New) : 线程对象被创建后,就进入了新建状态.例如,Thread thread = new Thread(). 就绪状态(Runnable) ...
- vue-cli 知识点
vue init webpack [project_name] 构建的项目,新增功能需要做的工作: table th:first-of-type { width: 100px; } table th: ...
- centos7 MFS drbd keepalived
环境: centos7.3 + moosefs 3.0.97 + drbd84-utils-8.9.8-1 + keepalived-1.2.13-9 工作原理: 架构图: 节点信息: 节点名 ...
- php 5.2.17 升级到5.3.29
修改php.ini配置文件 register_globals =On include_path = ".;d:/testoa/webroot" error_reporting = ...