From 35048dc5935bd425e1c8b6e132e44853d7c59299 Mon Sep 17 00:00:00 2001 From: Azureki Date: Tue, 18 Sep 2018 10:42:27 +0800 Subject: [PATCH] Sort Array By Parity --- lc905.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 lc905.py diff --git a/lc905.py b/lc905.py new file mode 100644 index 0000000..dea2393 --- /dev/null +++ b/lc905.py @@ -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]