摘要:
参考 https://www.cnblogs.com/jclian91/p/9151120.html 1.暴力算法 O(n^2) def maximum_subarray_1(nums): siz=len(nums) res=0 for i in range(siz): sum=0 for j in 阅读全文
摘要:
俺的: class Solution: def removeDuplicates(self, nums: List[int]) -> int: if(len(nums)==0): return 0 i=0 while i<len(nums): s=i while i<len(nums) and nu 阅读全文
摘要:
题目: 给定两个整数 n 和 k,返回 1 ... n 中所有可能的 k 个数的组合。 示例: 输入: n = 4, k = 2输出:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],] 解答: 回溯算法 Python: 1 class Solution: 2 d 阅读全文