MCPcopy Create free account
hub / github.com/HuberTRoy/leetCode / Solution

Class Solution

Array/SortArrayByParity.py:30–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29"""
30class Solution(object):
31 def sortArrayByParity(self, A):
32 """
33 :type A: List[int]
34 :rtype: List[int]
35 """
36 even = []
37 odd = []
38 for i in A:
39 if i % 2 == 0:
40 even.append(i)
41 else:
42 odd.append(i)
43
44 return even + odd
45
46
47

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected