摘要: def isValid(self,s): stack = [] paren_map = {')': '(', ']': '[', '}': '{'} for c in s: if c not in paren_map: stack.append(c) elif not stack or paren_map[c] !=... 阅读全文
posted @ 2018-10-21 21:26 PLAY_JOY 阅读(358) 评论(0) 推荐(0) 编辑
摘要: class Solution1(object): def __init__(self,x): self.val = x self.next = None def reverse_list(head): cur, pre = head, None while cur: cur.next... 阅读全文
posted @ 2018-10-21 17:43 PLAY_JOY 阅读(294) 评论(0) 推荐(0) 编辑