摘要:
提交: class Solution: def findLeastNumOfUniqueInts(self, arr: List[int], k: int) -> int: count = collections.Counter(arr) order_dic = sorted(count.items 阅读全文
摘要:
方法:倍增法dp ACM经典 class TreeAncestor: def __init__(self, n: int, parent: List[int]): self.cols = 20 # log(50000) < 20 self.dp = [[-1] * self.cols for _ i 阅读全文
摘要:
方法:迭代+栈 O(N) class Solution { public TreeNode recoverFromPreorder(String S) { Deque<TreeNode> path = new LinkedList<>(); int pos = 0; while(pos < S.le 阅读全文