Skip to content

Commit ca4bb09

Browse files
author
MIN JI CHOI
committed
0911
1 parent 9428894 commit ca4bb09

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎leetcode3/최민지/3467.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution:
2+
def transformArray(self, nums: List[int]) -> List[int]:
3+
odd, even = 0, 0
4+
for n in nums:
5+
if n % 2 == 0:
6+
even += 1
7+
else:
8+
odd += 1
9+
result = [0] * even + [1] * odd
10+
11+
return result

0 commit comments

Comments
 (0)