摘要:
# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# sel... 阅读全文
摘要:
1. binary tree inorder traversal 不能用recursive写 (LC原题)2. 比如有个数组F={1,3, 4, 5, 2, 0}, A=3, 那么F[A]=5, F[F[A]]=0, F[F[F[A]]]=1....这样下去求第N个数是多少. from: 1poin... 阅读全文
摘要:
class Solution(object): def divide(self, dividend, divisor): """ :type dividend: int :type divisor: int :rtype: int ... 阅读全文
摘要:
阅读全文
摘要:
#kmp class Solution(object): def strStr(self, haystack, needle): """ :type haystack: str :type needle: str :rtype: int ... 阅读全文
摘要:
class Solution(object): def removeElement(self, nums, val): """ :type nums: List[int] :type val: int :rtype: int ... 阅读全文
摘要:
class Solution(object): def removeDuplicates(self,nums): if len(nums) <= 0: return 0 j=0 for i in range(0,len(nums)): if... 阅读全文
摘要:
# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solutio... 阅读全文