摘要: 双指针思想:两个指针相隔n-1,每次两个指针向后一步,当后面一个指针没有后继了,前面一个指针的后继就是要删除的节点 # Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self. 阅读全文
posted @ 2016-10-25 21:53 火金队长 阅读(162) 评论(0) 推荐(0) 编辑
摘要: AC代码: class Solution(object): def countAndSay(self, n): """ :type n: int :rtype: str """ n=n-1 if n==0:return str(1) tag=1;stri=str(11) while tag<n: c 阅读全文
posted @ 2016-10-25 21:06 火金队长 阅读(424) 评论(0) 推荐(0) 编辑
摘要: class Solution(object): def isIsomorphic(self, s, t): """ :type s: str :type t: str :rtype: bool """ sdic={} slist=[] tdic={} tlist=[] if len(s)!=len( 阅读全文
posted @ 2016-10-25 19:47 火金队长 阅读(194) 评论(0) 推荐(0) 编辑