摘要:
题目描述: 方法: class Solution { public int countDigitOne(int n) { int digit = 1,res = 0; int high = n / 10,cur = n % 10,low = 0; while(high != 0 || cur != 阅读全文
摘要:
题目描述: 提交:O(N) class Solution: def buildArray(self, target: List[int], n: int) -> List[str]: res = [] a = "Push" b = "Pop" index = 1 for i in target: w 阅读全文
摘要:
题目描述: 提交:O(N3) class Solution: def countTriplets(self, arr: List[int]) -> int: # count = 0 # for i in range(len(arr)): # for j in range(i+1,len(arr)): 阅读全文
摘要:
题目描述: 方法一:DFS枚举 O(s*t) O(max(ds,dt) d代表深度 class Solution: def isSubtree(self, s: TreeNode, t: TreeNode) -> bool: def isSameTree(s, t): if not s and no 阅读全文