随笔分类 - 数据结构与算法
摘要:1.题目 题目地址(1209. 删除字符串中的所有相邻重复项 II - 力扣(LeetCode)) https://leetcode.cn/problems/remove-all-adjacent-duplicates-in-string-ii/ 题目描述 给你一个字符串 s,「k 倍重复项删除操作
阅读全文
摘要:1.题目 题目地址(316. 去除重复字母 - 力扣(LeetCode)) https://leetcode.cn/problems/remove-duplicate-letters/ 题目描述 给你一个字符串 s ,请你去除字符串中重复的字母,使得每个字母只出现一次。需保证 返回结果的字典序最小(
阅读全文
摘要:1.题目 题目地址(901. 股票价格跨度 - 力扣(LeetCode)) https://leetcode.cn/problems/online-stock-span/ 题目描述 设计一个算法收集某些股票的每日报价,并返回该股票当日价格的 跨度 。 当日股票价格的 跨度 被定义为股票价格小于或等于
阅读全文
摘要:1.题目 题目地址(739. 每日温度 - 力扣(LeetCode)) https://leetcode.cn/problems/daily-temperatures/ 题目描述 给定一个整数数组 temperatures ,表示每天的温度,返回一个数组 answer ,其中 answer[i] 是
阅读全文
摘要:1.题目介绍 题目地址(84. 柱状图中最大的矩形 - 力扣(LeetCode)) https://leetcode.cn/problems/largest-rectangle-in-histogram/ 题目描述 给定 n 个非负整数,用来表示柱状图中各个柱子的高度。每个柱子彼此相邻,且宽度为 1
阅读全文
摘要:1.题目 题目地址(496. 下一个更大元素 I - 力扣(LeetCode)) https://leetcode.cn/problems/next-greater-element-i/ 题目描述 nums1 中数字 x 的 下一个更大元素 是指 x 在 nums2 中对应位置 右侧 的 第一个 比
阅读全文
摘要:1.题目 题目地址(225. 用队列实现栈 - 力扣(LeetCode)) https://leetcode.cn/problems/implement-stack-using-queues/ 题目描述 请你仅使用两个队列实现一个后入先出(LIFO)的栈,并支持普通栈的全部四种操作(push、top
阅读全文
摘要:1.题目信息 题目地址(232. 用栈实现队列 - 力扣(LeetCode)) https://leetcode.cn/problems/implement-queue-using-stacks/ 题目描述 请你仅使用两个栈实现先入先出队列。队列应当支持一般队列支持的所有操作(push、pop、pe
阅读全文
摘要:1.题目 题目地址(349. 两个数组的交集 - 力扣(LeetCode)) https://leetcode.cn/problems/intersection-of-two-arrays/ 题目描述 给定两个数组 nums1 和 nums2 ,返回 它们的 交集 。输出结果中的每个元素一定是 唯一
阅读全文
摘要:1.题目 题目地址(706. 设计哈希映射 - 力扣(LeetCode)) https://leetcode.cn/problems/design-hashmap/ 题目描述 不使用任何内建的哈希表库设计一个哈希映射(HashMap)。 实现 MyHashMap 类: MyHashMap() 用空映
阅读全文
摘要:1.题目 题目地址(705. 设计哈希集合 - 力扣(LeetCode)) https://leetcode.cn/problems/design-hashset/ 题目描述 不使用任何内建的哈希表库设计一个哈希集合(HashSet)。 实现 MyHashSet 类: void add(key) 向
阅读全文
摘要:1.题目 题目地址(303. 区域和检索 - 数组不可变 - 力扣(LeetCode)) https://leetcode.cn/problems/range-sum-query-immutable/ 题目描述 给定一个整数数组 nums,处理以下类型的多个查询: 计算索引 left 和 right
阅读全文
摘要:1.题目 题目地址(430. 扁平化多级双向链表 - 力扣(LeetCode)) https://leetcode.cn/problems/flatten-a-multilevel-doubly-linked-list/ 题目描述 你会得到一个双链表,其中包含的节点有一个下一个指针、一个前一个指针和
阅读全文
摘要:1.题目 题目地址(82. 删除排序链表中的重复元素 II - 力扣(LeetCode)) https://leetcode.cn/problems/remove-duplicates-from-sorted-list-ii/ 题目描述 给定一个已排序的链表的头 head , 删除原始链表中所有重复
阅读全文

浙公网安备 33010602011771号