leetcode.cn 2026-05-20
🟡2657.find-the-prefix-common-array-of-two-arrays
🏷️ Tags
#bit_manipulation #array #hash_table
🟡2657.find-the-prefix-common-array-of-two-arrays
🏷️ Tags
#bit_manipulation #array #hash_table
Telegraph
find-the-prefix-common-array-of-two-arrays
给你两个下标从 0 开始长度为 n 的整数排列 A 和 B 。 A 和 B 的 前缀公共数组 定义为数组 C ,其中 C[i] 是数组 A 和 B 到下标为 i 之前公共元素的数目。 请你返回 A 和 B 的 前缀公共数组 。 如果一个长度为 n 的数组包含 1 到 n 的元素恰好一次,我们称这个数组是一个长度为 n 的 排列 。 示例 1: 输入:A = [1,3,2,4], B = [3,1,2,4] 输出:[0,2,3,4] 解释:i = 0:没有公共元素,所以 C[0] = 0 。 i = 1:1…
leetcode.com 2026-05-20
🟡2657.find-the-prefix-common-array-of-two-arrays
🏷️ Tags
#bit_manipulation #array #hash_table
🟡2657.find-the-prefix-common-array-of-two-arrays
🏷️ Tags
#bit_manipulation #array #hash_table
Telegraph
find-the-prefix-common-array-of-two-arrays
You are given two 0-indexed integer permutations A and B of length n. A prefix common array of A and B is an array C such that C[i] is equal to the count of numbers that are present at or before the index i in both A and B. Return the prefix common array…
leetcode.cn 2026-05-21
🟡3043.find-the-length-of-the-longest-common-prefix
🏷️ Tags
#trie #array #hash_table #string
🟡3043.find-the-length-of-the-longest-common-prefix
🏷️ Tags
#trie #array #hash_table #string
Telegraph
find-the-length-of-the-longest-common-prefix
给你两个 正整数 数组 arr1 和 arr2 。 正整数的 前缀 是其 最左边 的一位或多位数字组成的整数。例如,123 是整数 12345 的前缀,而 234 不是 。 设若整数 c 是整数 a 和 b 的 公共前缀 ,那么 c 需要同时是 a 和 b 的前缀。例如,5655359 和 56554 有公共前缀 565 和 5655,而 1223 和 43456 没有 公共前缀。 你需要找出属于 arr1 的整数 x 和属于 arr2 的整数 y 组成的所有数对 (x, y) 之中最长的公共前缀的长度。…
leetcode.com 2026-05-21
🟡3043.find-the-length-of-the-longest-common-prefix
🏷️ Tags
#trie #array #hash_table #string
🟡3043.find-the-length-of-the-longest-common-prefix
🏷️ Tags
#trie #array #hash_table #string
Telegraph
find-the-length-of-the-longest-common-prefix
You are given two arrays with positive integers arr1 and arr2. A prefix of a positive integer is an integer formed by one or more of its digits, starting from its leftmost digit. For example, 123 is a prefix of the integer 12345, while 234 is not. A common…
leetcode.cn 2026-05-30
🔴3161.block-placement-queries
🏷️ Tags
#binary_indexed_tree #segment_tree #array #binary_search
🔴3161.block-placement-queries
🏷️ Tags
#binary_indexed_tree #segment_tree #array #binary_search
Telegraph
block-placement-queries
有一条无限长的数轴,原点在 0 处,沿着 x 轴 正 方向无限延伸。 给你一个二维数组 queries ,它包含两种操作:
leetcode.com 2026-05-30
🔴3161.block-placement-queries
🏷️ Tags
#binary_indexed_tree #segment_tree #array #binary_search
🔴3161.block-placement-queries
🏷️ Tags
#binary_indexed_tree #segment_tree #array #binary_search
Telegraph
block-placement-queries
There exists an infinite number line, with its origin at 0 and extending towards the positive x-axis. You are given a 2D array queries, which contains two types of queries:
leetcode.cn 2026-06-01
🟢2144.minimum-cost-of-buying-candies-with-discount
🏷️ Tags
#greedy #array #sorting
🟢2144.minimum-cost-of-buying-candies-with-discount
🏷️ Tags
#greedy #array #sorting
Telegraph
minimum-cost-of-buying-candies-with-discount
一家商店正在打折销售糖果。每购买 两个 糖果,商店会 免费 送一个糖果。 免费送的糖果唯一的限制是:它的价格需要小于等于购买的两个糖果价格的 较小值 。
leetcode.com 2026-06-01
🟢2144.minimum-cost-of-buying-candies-with-discount
🏷️ Tags
#greedy #array #sorting
🟢2144.minimum-cost-of-buying-candies-with-discount
🏷️ Tags
#greedy #array #sorting
Telegraph
minimum-cost-of-buying-candies-with-discount
A shop is selling candies at a discount. For every two candies sold, the shop gives a third candy for free. The customer can choose any candy to take away for free as long as the cost of the chosen candy is less than or equal to the minimum cost of the two…