add #20 python implement

This commit is contained in:
haiker2011 2018-10-11 19:59:53 +08:00
parent 35f149c4ff
commit 55e44db5fa

View File

@ -1681,6 +1681,16 @@ class Solution:
return copyArray
```
```python
# -*- coding:utf-8 -*-
class Solution:
def reOrderArray(self, array):
# write code here
odd = [x for x in array if x%2]
even = [x for x in array if not (x%2)]
result = odd + even
return result
```
# 参考文献