摘要: 题目链接:https://leetcode-cn.com/problems/majority-element-ii/ 题目大意: 略。 分析: k个一起删, 最后check一下即可. 代码如下: 1 #define foreach(i,c) for (__typeof(c.begin()) i = 阅读全文
posted @ 2019-09-06 17:04 梦樱羽 阅读(227) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/majority-element/ 题目大意: 略。 分析: 略. 代码如下: 1 class Solution { 2 public: 3 int majorityElement(vector<int>& nums) { 阅读全文
posted @ 2019-09-06 16:14 梦樱羽 阅读(184) 评论(0) 推荐(0)
摘要: 题目链接:https://leetcode-cn.com/problems/shortest-unsorted-continuous-subarray/ 题目大意: 略. 分析: 如果排序区间为 [L, R], 那么 nums[L] 一定大于区间内的最小值,而 nums[R] 一定大于区间内的最大值 阅读全文
posted @ 2019-09-06 15:39 梦樱羽 阅读(356) 评论(0) 推荐(0)
Live2D