deno.land / x / masx200_leetcode_test@10.6.5 / sort-colors / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export default function sortColors(nums: number[]): void { const store = Array(3).fill(0);
for (const v of nums) { store[v]++; }
nums.length = 0;
for (const [k, v] of store.entries()) { nums.push(...Array(v).fill(k)); }}
masx200_leetcode_test

Version Info

Tagged at
a year ago