摘要:
```C++ class Solution { public: int rob(vector& nums) { if( nums.empty()){ return 0; } if( nums.size() == 1){ return nums[0]; } vect... 阅读全文
摘要:
```python3
class Solution: def maxSubArray(self, nums): """ :type nums: List[int] :rtype: int """ curr = nums[0] res = nums[0] # 当前子序列和只有在cu... 阅读全文
摘要:
```C++ #include class Solution { public: int maxSubArray(vector& nums) { int curr = 0; int res = INT_MIN; for(int i=0; i curr? res: curr; } return res; ... 阅读全文
摘要:
```python3
def climbStairs(self, n): """ :type n: int :rtype: int """ a = 1 b = 1 for i in range(n): a, b = b, a + b return a
``` 阅读全文