随笔分类 - 刷题记录
摘要:1821. 寻找今年具有正收入的客户 编写一个解决方案来报告 2021 年具有 正收入 的客户。 可以以 任意顺序 返回结果表。 select customer_id from Customers where year = 2021 and revenue > 0; select customer_
阅读全文
摘要:26 看到什么样的题目第一想法是可以用双指针 这个题用暴力破解法处理边界处理了好几次,但是使用双指针一下就通过了 双指针 class Solution { public int removeDuplicates(int[] nums) { if(nums.length <= 1){ return n
阅读全文
posted @ 2024-09-22 19:38
虚拟式
摘要:232.用栈实现队列 题目链接:https://leetcode.cn/problems/implement-queue-using-stacks/ 题目内容:请你仅使用两个栈实现先入先出队列。队列应当支持一般队列支持的所有操作(push、pop、peek、empty): 实现 MyQueue 类:
阅读全文
摘要:344.反转字符串 题目链接:https://leetcode.cn/problems/reverse-string/description/ 题目内容:编写一个函数,其作用是将输入的字符串反转过来。输入字符串以字符数组 s 的形式给出。 不要给另外的数组分配额外的空间,你必须原地修改输入数组、使用
阅读全文
摘要:454.四数相加II 题目链接:https://leetcode.cn/problems/4sum-ii/description/ 题目内容:给你四个整数数组 nums1、nums2、nums3 和 nums4 ,数组长度都是 n ,请你计算有多少个元组 (i, j, k, l) 能满足: 1、0
阅读全文
摘要:242. 有效的字母异位词 https://leetcode.cn/problems/valid-anagram/description/ 给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的字母异位词。 注意:若 s 和 t 中每个字符出现的次数都相同,则称 s 和 t 互为字母异
阅读全文
摘要:题目:24. 两两交换链表中的节点 - https://leetcode.cn/problems/swap-nodes-in-pairs/ 文章学习链接:https://programmercarl.com/0024.两两交换链表中的节点.html 题目: 19.删除链表的倒数第N个节点 - htt
阅读全文
摘要:题目: 203. 移除链表元素 - https://leetcode.cn/problems/remove-linked-list-elements/description/ 707. 设计链表 - https://leetcode.cn/problems/design-linked-list/ 2
阅读全文
摘要:题目链接:209.长度最小的子数组 - https://leetcode.cn/problems/minimum-size-subarray-sum/description/ 59. 螺旋矩阵 II - https://leetcode.cn/problems/spiral-matrix-ii/de
阅读全文
摘要:题目链接: 35. 搜索插入位置 - https://leetcode.cn/problems/search-insert-position/description/ 34. 在排序数组中查找元素的第一个和最后一个位置 - https://leetcode.cn/problems/find-firs
阅读全文
摘要:题目链接: 704. 二分查找 - https://leetcode.cn/problems/binary-search/description/ 27. 移除元素 - https://leetcode.cn/problems/remove-element/description/ 文章学习链接:h
阅读全文
摘要:写leetcode 242.有效的字母异位词,碰到两个问题 1、map更新数据 2、java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "ja
阅读全文

浙公网安备 33010602011771号