add #20 python implement
This commit is contained in:
parent
35f149c4ff
commit
55e44db5fa
@ -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
|
||||
```
|
||||
|
||||
# 参考文献
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user