摘要: # 解题思路: # 创建一个字典映射关系 dicts# 使用一个栈stk 遍历字符串s 得到一个新的字符串curItem 如果lastItem在dicts中的value和它相等 不做任何操作# 如果不等 入栈 有lastItem的 先append lastItem 然后是curItem ## 最后判... 阅读全文
posted @ 2015-11-21 23:51 hao.ma 阅读(166) 评论(0) 推荐(0)
摘要: # Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solutio... 阅读全文
posted @ 2015-11-21 22:35 hao.ma 阅读(113) 评论(0) 推荐(0)
摘要: class Solution(object): def fourSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[List[... 阅读全文
posted @ 2015-11-21 16:53 hao.ma 阅读(162) 评论(0) 推荐(0)
摘要: class Solution(object): def letterCombinations(self, digits): """ :type digits: str :rtype: List[str] """ if len... 阅读全文
posted @ 2015-11-21 00:00 hao.ma 阅读(119) 评论(0) 推荐(0)