摘要:
```C++ class Solution { public: void siftdown(vector& nums, int e, int begin, int end){ int i = begin; int j = 2*begin + 1; while(j nums[j]){ j++; } if(e > ... 阅读全文
摘要:
```C++ void siftdown(vector& nums, int e, int begin, int end){ int i = begin; int j = 2 begin + 1; while(j nums[j]){ j++; } if(e nums[j]){ break; } nu 阅读全文
摘要:
```python3
# 不是最优解,最优解应该用topK的思路
class Solution: def maximumProduct(self, nums): """ :type nums: List[int] :rtype: int """ nums.sort() res = [nums[-... 阅读全文
摘要:
```C++ class Solution { public: int removeDuplicates(vector& nums) { if(nums.empty()){ return 0; } if(nums.size()==1){ return 1 ; } int left = 0; int 阅读全文
摘要:
```C++ class Solution { public: int searchInsert(vector& nums, int target) { for(int i =0;i= target){ return i; } } return nums.size()-1; } ... 阅读全文
摘要:
```python3
class Solution: def twoSum(self, numbers, target): """ :type numbers: List[int] :type target: int :rtype: List[int] """ d = {} fo... 阅读全文