摘要:
300. 最长递增子序列 一开始想的是深度遍历加剪枝,然后就时间超时了,判断能否加入最长递增子序列,代码如下: 查看代码 class Solution { public: int lengthOfLIS(vector<int>& nums) { int result = 0; int minn = 阅读全文
摘要:
首先练习一下python,使用collection的Counter 查看代码 class Solution: def findDuplicate(self, nums: List[int]) -> int: a=Counter(nums) for i in a: if a[i] >= 2: retu 阅读全文