摘要: class Solution: def trailingZeroes(self, n: int) -> int: if n < 5: return 0 return n//5 + self.trailingZeroes(n//5) 阅读全文
posted @ 2020-05-09 14:49 星海寻梦233 阅读(55) 评论(0) 推荐(0) 编辑
摘要: class Solution: def convertToTitle(self, n: int) -> str: ans = "" while n: a = (n-1) % 26 n = (n-1) // 26 ans = chr(ord('A') + a) + ans return ans 阅读全文
posted @ 2020-05-09 14:47 星海寻梦233 阅读(81) 评论(0) 推荐(0) 编辑
摘要: # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def getIntersectionN 阅读全文
posted @ 2020-05-09 14:45 星海寻梦233 阅读(85) 评论(0) 推荐(0) 编辑
摘要: # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def hasCycle(self, h 阅读全文
posted @ 2020-05-09 14:43 星海寻梦233 阅读(152) 评论(0) 推荐(0) 编辑
摘要: class Solution: def isPalindrome(self, s: str) -> bool: s1 = s.split() s_tmp = "" for i in range(len(s1)): for j in range(len(s1[i])): if 'a'<= s1[i][ 阅读全文
posted @ 2020-05-09 14:41 星海寻梦233 阅读(78) 评论(0) 推荐(0) 编辑
摘要: class Solution: def maxProfit(self, prices: List[int]) -> int: length = len(prices) if length == 0: return 0 maxProfit = 0 minBuyPrice = prices[0] for 阅读全文
posted @ 2020-05-09 14:39 星海寻梦233 阅读(109) 评论(0) 推荐(0) 编辑
摘要: class Solution: def getRow(self, rowIndex: int) -> List[int]: ans = [1] for i in range(rowIndex + 1): tmp = [1 for i in range(i + 1)] for j in range(1 阅读全文
posted @ 2020-05-09 14:38 星海寻梦233 阅读(61) 评论(0) 推荐(0) 编辑
摘要: # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self. 阅读全文
posted @ 2020-05-09 14:37 星海寻梦233 阅读(99) 评论(0) 推荐(0) 编辑
摘要: # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self. 阅读全文
posted @ 2020-05-09 14:35 星海寻梦233 阅读(85) 评论(0) 推荐(0) 编辑
摘要: # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: 阅读全文
posted @ 2020-05-09 14:33 星海寻梦233 阅读(92) 评论(0) 推荐(0) 编辑