会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
小超不挑食
小超不吃海带
首页
新随笔
管理
上一页
1
2
3
4
5
6
7
···
17
下一页
2023年2月28日
2363. 合并相似的物品
摘要: class Solution { struct my_cmp{ bool operator()(const vector<int> &ite1, const vector<int> &ite2) { return ite1[0] < ite2[0]; // 升序 } } cmp; public: v
阅读全文
posted @ 2023-02-28 15:11 小超不挑食
阅读(25)
评论(0)
推荐(0)
2023年2月27日
【LeetCode】27. 移除元素
摘要: 移除指定元素 时间复杂度 O(n) 空间复杂度 O(1) class Solution { public: int removeElement(vector<int>& nums, int val) { int fast,low; for(fast = 0,low = 0; fast < nums.
阅读全文
posted @ 2023-02-27 14:39 小超不挑食
阅读(20)
评论(0)
推荐(0)
2023年2月23日
【LeetCode】206. 反转链表
摘要: 复杂度分析: 时间复杂度:O(n) 空间复杂度:O(1) /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nul
阅读全文
posted @ 2023-02-23 14:11 小超不挑食
阅读(14)
评论(0)
推荐(0)
2023年2月22日
【LeetCode】栈队列 :20. 有效的括号 1047. 删除字符串中的所有相邻重复项 150. 逆波兰表达式求值 239. 滑动窗口最大值 347. 前 K 个高频元素
摘要: 20. 有效的括号 class Solution { private: stack<char> st; public: bool isValid(string s) { for (int i = 0; i < s.size(); i++) { switch(s[i]) { case '{': cas
阅读全文
posted @ 2023-02-22 20:50 小超不挑食
阅读(25)
评论(0)
推荐(0)
2023年2月21日
【LeetCode】28. 找出字符串中第一个匹配项的下标 -- 459. 重复的子字符串
摘要: 找出字符串中第一个匹配项的下标 class Solution { public: int strStr(string haystack, string needle) { if (needle.size() == 0) return 0; vector<int> next(needle.size()
阅读全文
posted @ 2023-02-21 20:45 小超不挑食
阅读(20)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
17
下一页
公告