摘要:
题目描述: 方法一:找规律 class Solution { public int findNthDigit(int n) { int digit = 1; long start = 1; long count = 9; while(n > count){ n -= count; digit += 阅读全文
摘要:
题目描述: 提交:背包问题 class Solution: def largestNumber(self, cost, target: int) -> str: dp = [[0 for _ in range(target + 1)] for _ in range(10)] def tmax(a,b 阅读全文
摘要:
题目描述: 提交: class Solution: def goodNodes(self, root: TreeNode) -> int: def helper(m,node): r,left,right = 0,0,0 if node.val >= m: r = 1 if node.left: l 阅读全文
摘要:
题目描述: 提交: class Solution: def simplifiedFractions(self, n: int) -> List[str]: def gcd(a, b): if b > a: return gcd(b, a) if a % b == 0: return b return 阅读全文