当前位置:网站首页>Force buckle 912 Sort array
Force buckle 912 Sort array
2022-07-07 20:06:00 【Tomorrowave】
Code section
Give you an array of integers nums, Please arrange the array in ascending order .
Example 1:
Input :nums = [5,2,3,1]
Output :[1,2,3,5]
Example 2:
Input :nums = [5,1,1,2,0,0]
Output :[0,0,1,1,2,5]
Tips :
1 <= nums.length <= 5 * 104
-5 * 104 <= nums[i] <= 5 * 104
Ideas
Ascending order list.sort()
Code section
class Solution:
def sortArray(self, nums: List[int]) -> List[int]:
nums.sort()
return nums
边栏推荐
- torch. nn. functional. Pad (input, pad, mode= 'constant', value=none) record
- Simulate the implementation of string class
- Force buckle 1790 Can two strings be equal by performing string exchange only once
- 模拟实现string类
- 使用高斯Redis实现二级索引
- [auto.js] automatic script
- 毕业季|遗憾而又幸运的毕业季
- Equals method
- 力扣 1790. 仅执行一次字符串交换能否使两个字符串相等
- Browse the purpose of point setting
猜你喜欢
项目经理『面试八问』,看了等于会了
Le PGR est - il utile au travail? Comment choisir une plate - forme fiable pour économiser le cœur et la main - d'œuvre lors de la préparation de l'examen!!!
Force buckle 599 Minimum index sum of two lists
Some important knowledge of MySQL
编译器优化那些事儿(4):归纳变量
PMP對工作有益嗎?怎麼選擇靠譜平臺讓備考更省心省力!!!
openEuler 有奖捉虫活动,来参与一下?
剑指 Offer II 013. 二维子矩阵的和
Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"
8 CAS
随机推荐
使用高斯Redis实现二级索引
Simulate the implementation of string class
831. KMP字符串
RESTAPI 版本控制策略【eolink 翻译】
华南X99平台打鸡血教程
【剑指offer】剑指 Offer II 012. 左右两边子数组的和相等
pom. Brief introduction of XML configuration file label function
力扣 1037.有效的回旋镖
How to cooperate among multiple threads
力扣599. 两个列表的最小索引总和
pom.xml 配置文件标签作用简述
How to buy bank financial products? Do you need a bank card?
Force buckle 599 Minimum index sum of two lists
力扣 912.排序数组
Training IX basic configuration of network services
gorilla官方:golang开websocket client的示例代码
一文读懂数仓中的pg_stat
力扣674. 最长连续递增序列
微信公众号OAuth2.0授权登录并显示用户信息
torch. nn. functional. Pad (input, pad, mode= 'constant', value=none) record