摘要:
class Solution: def trailingZeroes(self, n: int) -> int: if n < 5: return 0 return n//5 + self.trailingZeroes(n//5) 阅读全文
摘要:
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 阅读全文
摘要:
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def getIntersectionN 阅读全文
摘要:
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def hasCycle(self, h 阅读全文
摘要:
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][ 阅读全文
摘要:
class Solution: def maxProfit(self, prices: List[int]) -> int: length = len(prices) if length == 0: return 0 maxProfit = 0 minBuyPrice = prices[0] for 阅读全文
摘要:
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 阅读全文
摘要:
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self. 阅读全文
摘要:
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self. 阅读全文
摘要:
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: 阅读全文