摘要: class Solution: def judgeCircle(self, moves: str) -> bool: location = [0, 0] for m in moves: if m == 'L': location[0] -= 1 elif m == 'R': ... 阅读全文
posted @ 2019-04-09 18:11 周洋 阅读(103) 评论(0) 推荐(0) 编辑
摘要: class Solution(object): def sortArrayByParity(self, A): return [x for x in A if x % 2 == 0] + [x for x in A if x % 2 == 1] 阅读全文
posted @ 2019-04-09 06:26 周洋 阅读(120) 评论(0) 推荐(0) 编辑
摘要: python列表切片有~这种简单表示. 阅读全文
posted @ 2019-04-09 06:20 周洋 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 暴搜.. 阅读全文
posted @ 2019-04-09 06:08 周洋 阅读(233) 评论(0) 推荐(0) 编辑
摘要: python二分插入,使用bisect(教程) 阅读全文
posted @ 2019-04-09 05:26 周洋 阅读(73) 评论(0) 推荐(0) 编辑
摘要: class Solution(object): def sortedSquares(self, A): """ :type A: List[int] :rtype: List[int] """ return sorted([x * x for x in A]) 阅读全文
posted @ 2019-04-09 05:03 周洋 阅读(160) 评论(0) 推荐(0) 编辑