摘要: class Solution: def calcu(self,ele:List[str],loc): index_p = [-1]*2 #只记录离R最近位置的p和B(左右) index_B = [-1]*2 left,right = 0,0 for i in range(len(ele)): if 阅读全文
posted @ 2019-02-27 14:53 bluedream1000 阅读(182) 评论(0) 推荐(0) 编辑
摘要: class Solution: def flipAndInvertImage(self, A: List[List[int]]) -> List[List[int]]: for a in A: first = 0 last = len(a)-1 while first<last: a[first], 阅读全文
posted @ 2019-02-27 10:43 bluedream1000 阅读(114) 评论(0) 推荐(0) 编辑
摘要: class Solution: def sortArrayByParity(self, A: List[int]) -> List[int]: first = 0 last = len(A)-1 while first<last: m = A[first] n = A[last] if (m&1 i 阅读全文
posted @ 2019-02-27 09:46 bluedream1000 阅读(133) 评论(0) 推荐(0) 编辑