leetcode.cn 2023-10-08
🟡2034.stock-price-fluctuation
🏷️ Tags
#design #hash_table #data_stream #ordered_set #heap_priority_queue
🟡2034.stock-price-fluctuation
🏷️ Tags
#design #hash_table #data_stream #ordered_set #heap_priority_queue
Telegraph
stock-price-fluctuation
给你一支股票价格的数据流。数据流中每一条记录包含一个 时间戳 和该时间点股票对应的 价格 。 不巧的是,由于股票市场内在的波动性,股票价格记录可能不是按时间顺序到来的。某些情况下,有的记录可能是错的。如果两个有相同时间戳的记录出现在数据流中,前一条记录视为错误记录,后出现的记录 更正 前一条错误的记录。 请你设计一个算法,实现:
leetcode.com 2023-10-11
🔴2251.number-of-flowers-in-full-bloom
🏷️ Tags
#array #hash_table #binary_search #ordered_set #prefix_sum #sorting
🔴2251.number-of-flowers-in-full-bloom
🏷️ Tags
#array #hash_table #binary_search #ordered_set #prefix_sum #sorting
Telegraph
number-of-flowers-in-full-bloom
You are given a 0-indexed 2D integer array flowers, where flowers[i] = [starti, endi] means the ith flower will be in full bloom from starti to endi (inclusive). You are also given a 0-indexed integer array people of size n, where people[i] is the time that…
leetcode.com 2023-12-17
🟡2353.design-a-food-rating-system
🏷️ Tags
#design #hash_table #ordered_set #heap_priority_queue
🟡2353.design-a-food-rating-system
🏷️ Tags
#design #hash_table #ordered_set #heap_priority_queue
Telegraph
design-a-food-rating-system
Design a food rating system that can do the following:
leetcode.cn 2025-02-28
🟡2353.design-a-food-rating-system
🏷️ Tags
#design #array #hash_table #string #ordered_set #heap_priority_queue
🟡2353.design-a-food-rating-system
🏷️ Tags
#design #array #hash_table #string #ordered_set #heap_priority_queue
Telegraph
design-a-food-rating-system
设计一个支持下述操作的食物评分系统:
leetcode.cn 2025-03-20
🔴2612.minimum-reverse-operations
🏷️ Tags
#breadth_first_search #array #ordered_set
🔴2612.minimum-reverse-operations
🏷️ Tags
#breadth_first_search #array #ordered_set
Telegraph
minimum-reverse-operations
给你一个整数 n 和一个在范围 [0, n - 1] 以内的整数 p ,它们表示一个长度为 n 且下标从 0 开始的数组 arr ,数组中除了下标为 p 处是 1 以外,其他所有数都是 0 。 同时给你一个整数数组 banned ,它包含数组中的一些位置。banned 中第 i 个位置表示 arr[banned[i]] = 0 ,题目保证 banned[i] != p 。 你可以对 arr 进行 若干次 操作。一次操作中,你选择大小为 k 的一个 子数组 ,并将它 翻转 。在任何一次翻转操作后,你都需要确保…
leetcode.cn 2025-04-15
🔴2179.count-good-triplets-in-an-array
🏷️ Tags
#binary_indexed_tree #segment_tree #array #binary_search #divide_and_conquer #ordered_set #merge_sort
🔴2179.count-good-triplets-in-an-array
🏷️ Tags
#binary_indexed_tree #segment_tree #array #binary_search #divide_and_conquer #ordered_set #merge_sort
Telegraph
count-good-triplets-in-an-array
给你两个下标从 0 开始且长度为 n 的整数数组 nums1 和 nums2 ,两者都是 [0, 1, ..., n - 1] 的 排列 。 好三元组 指的是 3 个 互不相同 的值,且它们在数组 nums1 和 nums2 中出现顺序保持一致。换句话说,如果我们将 pos1v 记为值 v 在 nums1 中出现的位置,pos2v 为值 v 在 nums2 中的位置,那么一个好三元组定义为 0 <= x, y, z <= n - 1 ,且 pos1x < pos1y < pos1z 和 pos2x < pos2y…
leetcode.com 2025-04-15
🔴2179.count-good-triplets-in-an-array
🏷️ Tags
#binary_indexed_tree #segment_tree #array #binary_search #divide_and_conquer #ordered_set #merge_sort
🔴2179.count-good-triplets-in-an-array
🏷️ Tags
#binary_indexed_tree #segment_tree #array #binary_search #divide_and_conquer #ordered_set #merge_sort
Telegraph
count-good-triplets-in-an-array
You are given two 0-indexed arrays nums1 and nums2 of length n, both of which are permutations of [0, 1, ..., n - 1]. A good triplet is a set of 3 distinct values which are present in increasing order by position both in nums1 and nums2. In other words, if…
👍1
leetcode.com 2025-08-05
🟢3477.fruits-into-baskets-ii
🏷️ Tags
#segment_tree #array #binary_search #ordered_set #simulation
🟢3477.fruits-into-baskets-ii
🏷️ Tags
#segment_tree #array #binary_search #ordered_set #simulation
Telegraph
fruits-into-baskets-ii
You are given two arrays of integers, fruits and baskets, each of length n, where fruits[i] represents the quantity of the ith type of fruit, and baskets[j] represents the capacity of the jth basket. From left to right, place the fruits according to these…
leetcode.cn 2025-08-06
🟡3479.fruits-into-baskets-iii
🏷️ Tags
#segment_tree #array #binary_search #ordered_set
🟡3479.fruits-into-baskets-iii
🏷️ Tags
#segment_tree #array #binary_search #ordered_set
Telegraph
fruits-into-baskets-iii
给你两个长度为 n 的整数数组,fruits 和 baskets,其中 fruits[i] 表示第 i 种水果的 数量,baskets[j] 表示第 j 个篮子的 容量。
leetcode.com 2025-08-06
🟡3479.fruits-into-baskets-iii
🏷️ Tags
#segment_tree #array #binary_search #ordered_set
🟡3479.fruits-into-baskets-iii
🏷️ Tags
#segment_tree #array #binary_search #ordered_set
Telegraph
fruits-into-baskets-iii
You are given two arrays of integers, fruits and baskets, each of length n, where fruits[i] represents the quantity of the ith type of fruit, and baskets[j] represents the capacity of the jth basket. From left to right, place the fruits according to these…
leetcode.cn 2025-09-17
🟡2349.design-a-number-container-system
🏷️ Tags
#design #hash_table #ordered_set #heap_priority_queue
🟡2349.design-a-number-container-system
🏷️ Tags
#design #hash_table #ordered_set #heap_priority_queue
Telegraph
design-a-number-container-system
设计一个数字容器系统,可以实现以下功能: