| 24 | |
| 25 | """ |
| 26 | class Solution(object): |
| 27 | def sortArrayByParityII(self, A): |
| 28 | """ |
| 29 | :type A: List[int] |
| 30 | :rtype: List[int] |
| 31 | """ |
| 32 | |
| 33 | odd = [] |
| 34 | even = [] |
| 35 | |
| 36 | for i in A: |
| 37 | if i%2 == 0: |
| 38 | even.append(i) |
| 39 | else: |
| 40 | odd.append(i) |
| 41 | |
| 42 | result = [] |
| 43 | for j, k in zip(even, odd): |
| 44 | result.append(j) |
| 45 | result.append(k) |
| 46 | return result |
| 47 |
nothing calls this directly
no outgoing calls
no test coverage detected