摘要: 题目地址:https://leetcode-cn.com/problems/remove-element/ 解题思路:设置新的下标 class Solution { public: int removeElement(vector<int>& nums, int val) { if (nums.si 阅读全文
posted @ 2020-10-12 19:34 CCxiao5 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 题目地址:https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/ 解题思路:设计标记。 class Solution { public: int removeDuplicates(vector<int>& nums) 阅读全文
posted @ 2020-10-12 19:32 CCxiao5 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 题目地址:https://leetcode-cn.com/problems/reverse-nodes-in-k-group/ 解题思路:增加头结点,通过头结点来实现倒序。 class Solution { public: ListNode* reverseKGroup(ListNode* head 阅读全文
posted @ 2020-10-12 18:45 CCxiao5 阅读(61) 评论(0) 推荐(0) 编辑