当前位置:网站首页>LeetCode-922. Sort Array By Parity II
LeetCode-922. Sort Array By Parity II
2022-08-10 16:04:00 【51CTO】
Given an array A
of non-negative integers, half of the integers in A are odd, and half of the integers are even.
Sort the array so that whenever A[i]
is odd, i
is odd; and whenever A[i]
is even, i
is even.
You may return any answer array that satisfies this condition.
Example 1:
Note:
-
2 <= A.length <= 20000
-
A.length % 2 == 0
-
0 <= A[i] <= 1000
题解:
边栏推荐
猜你喜欢
TCP为什么是三次握手和四次挥手?
Software Test Cases
Oracle数据库备份dmp文件太大,有什么办法可以在备份的时候拆分成多个dmp吗?
持续集成实战 —— Jenkins自动化测试环境搭建
Exchange Online审计和监控
【FreeRTOS】13 动态内存管理
FP6378AS5CTR SOT - 23-5 effective 1 mhz2a synchronous buck regulator
数据治理项目成功的要点,企业培养数据要把握好关键环节
一个 ABAP Development Tool 自定义 service endpoint 的测试工具
Servlet简单项目操作
随机推荐
scala 10种函数高级应用
利用SparkLauncher 提交Job
推荐几款最好用的MySQL开源客户端,建议收藏!
Common conventions such as common SQL and API interfaces
SYM32——RTC实时时钟程序讲解
头脑风暴:目标和
Ameya360成为稳先微电子中国区域授权代理!
2022年软考复习笔记一
功能测试vs.非功能测试:能否非此即彼地进行选择?
软件配置 | pip下载第三方库文件及配置pip源的不完全总结
JVM学习——2——内存加载过程(类加载器)
Colocate Join :ClickHouse的一种高性能分布式join查询模型
持续集成实战 —— Jenkins自动化测试环境搭建
潜水员 ← 二维费用的背包问题
请查收 2022华为开发者大赛备赛攻略
A Sina Weibo semantic sentiment analysis tool developed by ABAP
TestLink Export Use Case Transformation Tool
架构设计之一——基础架构
QOS function introduction
Asterisk SIP media path