Skip to content

Commit

Permalink
Sort Array By Parity
Browse files Browse the repository at this point in the history
  • Loading branch information
rinwf committed Sep 18, 2018
1 parent 1b01a47 commit 35048dc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lc905.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class Solution:
def sortArrayByParity(self, A):
"""
:type A: List[int]
:rtype: List[int]
"""
return [x for x in A if x % 2 == 0] + [x for x in A if x % 2 == 1]

0 comments on commit 35048dc

Please sign in to comment.