deno.land / x / masx200_leetcode_test@10.6.5 / sort-colors / index.ts
1234567891011121314export 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)); }}
Version Info