leetcode.cn 2026-11-23
🟡1352.product-of-the-last-k-numbers
🏷️ Tags
#design #array #math #data_stream #prefix_sum
🟡1352.product-of-the-last-k-numbers
🏷️ Tags
#design #array #math #data_stream #prefix_sum
Telegraph
product-of-the-last-k-numbers
设计一个算法,该算法接受一个整数流并检索该流中最后 k 个整数的乘积。 实现 ProductOfNumbers 类:
leetcode.com 2026-11-23
🟡1352.product-of-the-last-k-numbers
🏷️ Tags
#design #array #math #data_stream #prefix_sum
🟡1352.product-of-the-last-k-numbers
🏷️ Tags
#design #array #math #data_stream #prefix_sum
Telegraph
product-of-the-last-k-numbers
Design an algorithm that accepts a stream of integers and retrieves the product of the last k integers of the stream. Implement the ProductOfNumbers class:
leetcode.cn 2026-11-24
🟢3411.maximum-subarray-with-equal-products
🏷️ Tags
#array #math #enumeration #number_theory #sliding_window
🟢3411.maximum-subarray-with-equal-products
🏷️ Tags
#array #math #enumeration #number_theory #sliding_window
Telegraph
maximum-subarray-with-equal-products
给你一个由 正整数 组成的数组 nums。 如果一个数组 arr 满足 prod(arr) == lcm(arr) * gcd(arr),则称其为 乘积等价数组 ,其中:
leetcode.com 2026-11-24
🟢3411.maximum-subarray-with-equal-products
🏷️ Tags
#array #math #enumeration #number_theory #sliding_window
🟢3411.maximum-subarray-with-equal-products
🏷️ Tags
#array #math #enumeration #number_theory #sliding_window
Telegraph
maximum-subarray-with-equal-products
You are given an array of positive integers nums. An array arr is called product equivalent if prod(arr) == lcm(arr) * gcd(arr), where:
leetcode.cn 2026-11-25
🔴3934.smallest-unique-subarray
🏷️ Tags
#array #hash_table #binary_search #suffix_array #hash_function #rolling_hash
🔴3934.smallest-unique-subarray
🏷️ Tags
#array #hash_table #binary_search #suffix_array #hash_function #rolling_hash
Telegraph
smallest-unique-subarray
给你一个整数数组 nums 。 找出 nums 中与其他任何 子数组 均 不 相同 的 子数组 的 最小 长度。 返回一个整数,表示此类 子数组 的 最小可能长度 。 子数组 是数组中的一个连续的非空元素序列。 如果两个 子数组 具有相同的长度,并且对应位置的元素也相同,则认为这两个 子数组 是相同的。 示例 1: 输入: nums = [3,3,3] 输出: 3 解释:
leetcode.com 2026-11-25
🔴3934.smallest-unique-subarray
🏷️ Tags
#array #hash_table #binary_search #suffix_array #hash_function #rolling_hash
🔴3934.smallest-unique-subarray
🏷️ Tags
#array #hash_table #binary_search #suffix_array #hash_function #rolling_hash
Telegraph
smallest-unique-subarray
You are given an integer array nums. Find the minimum length of a subarray that is not identical to any other subarray in nums. Return an integer denoting the minimum possible length of such a subarray. Two subarrays are considered identical if they have…
leetcode.cn 2026-11-27
🟡3946.maximum-number-of-items-from-sale-i
🏷️ Tags
#greedy #array #dynamic_programming
🟡3946.maximum-number-of-items-from-sale-i
🏷️ Tags
#greedy #array #dynamic_programming
Telegraph
maximum-number-of-items-from-sale-i
给你一个二维整数数组 items,其中 items[i] = [factori, pricei] 表示下标为 i 的物品。同时给你一个整数 budget。 每种物品都有无限个可供购买。你可以购买任意数量的任意物品,但购买物品的总花费最多为 budget。 购买物品后,你可以根据以下规则获得免费的物品:
leetcode.com 2026-11-27
🟡3946.maximum-number-of-items-from-sale-i
🏷️ Tags
#greedy #array #dynamic_programming
🟡3946.maximum-number-of-items-from-sale-i
🏷️ Tags
#greedy #array #dynamic_programming
Telegraph
maximum-number-of-items-from-sale-i
You are given a 2D integer array items, where items[i] = [factori, pricei] represents the ith item. You are also given an integer budget. There are unlimited copies of each item available for purchase.You may buy any number of copies of any items such that…
leetcode.cn 2026-11-28
🟡3947.maximum-number-of-items-from-sale-ii
🏷️ Tags
#greedy #array #sorting #heap_priority_queue
🟡3947.maximum-number-of-items-from-sale-ii
🏷️ Tags
#greedy #array #sorting #heap_priority_queue
Telegraph
maximum-number-of-items-from-sale-ii
给你一个二维整数数组 items,其中 items[i] = [factori, pricei] 表示下标为 i 的物品。同时给你一个整数 budget。 每种物品都有无限个可供购买。你可以购买任意数量的任意物品,但购买物品的总花费最多为 budget。 购买物品后,你可以根据以下规则获得免费的物品:
leetcode.com 2026-11-28
🟡3947.maximum-number-of-items-from-sale-ii
🏷️ Tags
#greedy #array #sorting #heap_priority_queue
🟡3947.maximum-number-of-items-from-sale-ii
🏷️ Tags
#greedy #array #sorting #heap_priority_queue
Telegraph
maximum-number-of-items-from-sale-ii
You are given a 2D integer array items, where items[i] = [factori, pricei] represents the ith item. You are also given an integer budget. There are unlimited copies of each item available for purchase. You may buy any number of copies of any items such that…
leetcode.cn 2026-12-01
🟡1201.ugly-number-iii
🏷️ Tags
#math #binary_search #combinatorics #greatest_common_divisor #number_theory #inclusion_exclusion_principle #euclidean_algorithm #least_common_multiple
🟡1201.ugly-number-iii
🏷️ Tags
#math #binary_search #combinatorics #greatest_common_divisor #number_theory #inclusion_exclusion_principle #euclidean_algorithm #least_common_multiple
Telegraph
ugly-number-iii
丑数是可以被 a 或 b 或 c 整除的 正整数 。 给你四个整数:n 、a 、b 、c ,请你设计一个算法来找出第 n 个丑数。 示例 1: 输入:n = 3, a = 2, b = 3, c = 5 输出:4 解释:丑数序列为 2, 3, 4, 5, 6, 8, 9, 10... 其中第 3 个是 4。 示例 2: 输入:n = 4, a = 2, b = 3, c = 4 输出:6 解释:丑数序列为 2, 3, 4, 6, 8, 9, 10, 12... 其中第 4 个是 6。 示例 3: 输入:n…
leetcode.com 2026-12-01
🟡1201.ugly-number-iii
🏷️ Tags
#math #binary_search #combinatorics #greatest_common_divisor #number_theory #inclusion_exclusion_principle #euclidean_algorithm #least_common_multiple
🟡1201.ugly-number-iii
🏷️ Tags
#math #binary_search #combinatorics #greatest_common_divisor #number_theory #inclusion_exclusion_principle #euclidean_algorithm #least_common_multiple
Telegraph
ugly-number-iii
An ugly number is a positive integer that is divisible by a, b, or c. Given four integers n, a, b, and c, return the nth ugly number. Example 1: Input: n = 3, a = 2, b = 3, c = 5 Output: 4 Explanation: The ugly numbers are 2, 3, 4, 5, 6, 8, 9, 10... The…
leetcode.cn 2026-12-02
🟡1202.smallest-string-with-swaps
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #hash_table #string #sorting
🟡1202.smallest-string-with-swaps
🏷️ Tags
#depth_first_search #breadth_first_search #union_find #array #hash_table #string #sorting
Telegraph
smallest-string-with-swaps
给你一个字符串 s,以及该字符串中的一些「索引对」数组 pairs,其中 pairs[i] = [a, b] 表示字符串中的两个索引(编号从 0 开始)。 你可以 任意多次交换 在 pairs 中任意一对索引处的字符。 返回在经过若干次交换后,s 可以变成的按字典序最小的字符串。 示例 1: 输入:s = "dcab", pairs = [[0,3],[1,2]] 输出:"bacd" 解释: 交换 s[0] 和 s[3], s = "bcad" 交换 s[1] 和 s[2], s = "bacd" 示例…