摘要:
#### 算数运算 ```lua Set = {} function Set.union(a, b) local res = Set.new{} for k in pairs(a) do res[k] = true end for k in pairs(b) do res[k] = true end 阅读全文
摘要:
32. Longest Valid Parentheses 最长有效括号 题目描述 Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed 阅读全文
摘要:
55. 跳跃游戏 能跳一个范围,贪心 class Solution { public: bool canJump(vector<int>& nums) { int m = 0; //每次拓展最右端点,大于nums.size()-1时返回 for(int i = 0; i < nums.size() 阅读全文
摘要:
快速排序: void QuickSort(vector<int>& nums, int lo, int hi){ if(lo < hi){ int p = partition(nums,lo,hi); QuickSort(nums,lo,p-1); QuickSort(nums,p+1,hi); } 阅读全文