Skip to content

Commit f9aa3ce

Browse files
committed
Time: 39 ms (84.6%), Space: 16.3 MB (33.49%) - LeetHub
1 parent 5e48602 commit f9aa3ce

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

0075-sort-colors/0075-sort-colors.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from collections import Counter
2+
class Solution:
3+
def sortColors(self, nums: List[int]) -> None:
4+
cnt = Counter(nums)
5+
nums[:] = [0] * cnt[0] + [1] * cnt[1] + [2] * cnt[2]

0 commit comments

Comments
 (0)