Skip to content

Commit e646911

Browse files
Merge pull request #2011 from CodingTestStudy2/최민지
[최민지] Day11
2 parents 6f7a767 + ca4bb09 commit e646911

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)