随笔分类 -  Leetcode

leetcode刷题记录
摘要:思路1 1.暴力解法,两重循环,从某一个下标开始,计算连续的和,求最大 代码 class Solution { public: int maxSubArray(vector<int> &nums) { //类似寻找最大最小值的题目,初始值一定要定义成理论上的最小最大值 int max = INT_M 阅读全文
posted @ 2021-09-26 15:22 A-inspire 阅读(37) 评论(0) 推荐(0)
摘要:代码: class Solution { public: vector<int> dailyTemperatures(vector<int>& T) { int length = int(T.size()); vector<int>result(length,0); //需要指定长度 stack<i 阅读全文
posted @ 2021-09-26 15:16 A-inspire 阅读(34) 评论(0) 推荐(0)