当前位置:网站首页>LeetCode-922. Sort Array By Parity II
LeetCode-922. Sort Array By Parity II
2022-08-10 15:36: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为什么是三次握手和四次挥手?
- Network engineer's backpack (EDC summary recommendation)
- 5G NR MIB详解
- Detailed understanding of all built-in functions (Part 2)
- const修饰的指针变量(详解)
- FFmpeg 交叉编译
- Reids 源码导读
- HUAWEI CLOUD DevCloud received the highest-level certification of the first batch of cloud-native technology architecture maturity assessments by the China Academy of Information and Communications Te
- $'\r': command not found
- Please check the preparation guide for the 2022 Huawei Developer Competition
猜你喜欢
随机推荐
Oracle数据库备份dmp文件太大,有什么办法可以在备份的时候拆分成多个dmp吗?
【21天学习挑战赛】直接选择排序
虚拟电厂可视化大屏,深挖痛点精准减碳
Pytest framework optimization
软件测试用例篇
全部内置函数详细认识(中篇)
NPM - Cannot read properties of null (reading 'pickAlgorithm') 解决方案
Basic learning of XML
metaForce佛萨奇2.0系统开发功能逻辑介绍
【芯片】人人皆可免费造芯?谷歌开源芯片计划已释放90nm、130nm和180nm工艺设计套件
并发容器线程安全应对之道
ExceptionInInitializerError
Mysql statement analysis, storage engine, index optimization, etc.
E. Cross Swapping (and check out deformation/good questions)
【每日一题】【leetcode】26. 链表-链表中倒数第k个节点
Reids 源码导读
潜水员 ← 二维费用的背包问题
易基因|深度综述:m6A RNA甲基化在大脑发育和疾病中的表观转录调控作用
为什么中国的数字是四位一进,而西方的是三位一进?
scala basics








