We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4335d85 commit b760478Copy full SHA for b760478
README.md
@@ -10,6 +10,8 @@ leetcode 测试
10
11
##### 包含的内容如下
12
13
+https://leetcode.cn/problems/diao-zheng-shu-zu-shun-xu-shi-qi-shu-wei-yu-ou-shu-qian-mian-lcof/
14
+
15
https://leetcode.cn/problems/ba-shu-zu-pai-cheng-zui-xiao-de-shu-lcof/
16
17
https://leetcode.cn/problems/di-yi-ge-zhi-chu-xian-yi-ci-de-zi-fu-lcof/
diao-zheng-shu-zu-shun-xu-shi-qi-shu-wei-yu-ou-shu-qian-mian-lcof/index.ts
@@ -0,0 +1,7 @@
1
+import { groupBy } from "../deps.ts";
2
3
+export default function exchange(nums: number[]): number[] {
4
+ return Object.values(
5
+ groupBy(nums, (a) => Number(!(a % 2))),
6
+ ).flat() as number[];
7
+}
0 commit comments