摘要:
自己写的: class Solution: def detectCapitalUse(self, word: str) -> bool: n=len(word) count=0 for i in word: if self.is_upper(i): count+=1 if count==0: ret 阅读全文
摘要:
自己写的: class Solution: # getMinimumDifference 方法接收一个二叉树的根节点 root,并返回树中所有节点值的最小差值 def getMinimumDifference(self, root: Optional[TreeNode]) -> int: # 初始化 阅读全文
摘要:
自己写的: class Solution: # getMinimumDifference 方法接收一个二叉树的根节点 root,并返回树中所有节点值的最小差值 def getMinimumDifference(self, root: Optional[TreeNode]) -> int: # 初始化 阅读全文
摘要:
自己写的: class Solution: def reverseStr(self, s: str, k: int) -> str: # 初始化两个空列表:s_li用于存储切分后的字符串片段,res用于存储处理后的片段 s_li = [] res = [] # 遍历字符串,步长为2*k,切分成每2* 阅读全文