leetcode.cn 2025-04-08
🟢3396.minimum-number-of-operations-to-make-elements-in-array-distinct
🏷️ Tags
#array #hash_table
🟢3396.minimum-number-of-operations-to-make-elements-in-array-distinct
🏷️ Tags
#array #hash_table
Telegraph
minimum-number-of-operations-to-make-elements-in-array-distinct
给你一个整数数组 nums,你需要确保数组中的元素 互不相同 。为此,你可以执行以下操作任意次:
leetcode.com 2025-04-08
🟢3396.minimum-number-of-operations-to-make-elements-in-array-distinct
🏷️ Tags
#array #hash_table
🟢3396.minimum-number-of-operations-to-make-elements-in-array-distinct
🏷️ Tags
#array #hash_table
Telegraph
minimum-number-of-operations-to-make-elements-in-array-distinct
You are given an integer array nums. You need to ensure that the elements in the array are distinct. To achieve this, you can perform the following operation any number of times:
leetcode.com 2025-04-09
🟢3375.minimum-operations-to-make-array-values-equal-to-k
🏷️ Tags
#array #hash_table
🟢3375.minimum-operations-to-make-array-values-equal-to-k
🏷️ Tags
#array #hash_table
Telegraph
minimum-operations-to-make-array-values-equal-to-k
You are given an integer array nums and an integer k. An integer h is called valid if all values in the array that are strictly greater than h are identical. For example, if nums = [10, 8, 10, 8], a valid integer is h = 9 because all nums[i] > 9 are equal…
leetcode.cn 2025-04-10
🔴2999.count-the-number-of-powerful-integers
🏷️ Tags
#math #string #dynamic_programming
🔴2999.count-the-number-of-powerful-integers
🏷️ Tags
#math #string #dynamic_programming
Telegraph
count-the-number-of-powerful-integers
给你三个整数 start ,finish 和 limit 。同时给你一个下标从 0 开始的字符串 s ,表示一个 正 整数。 如果一个 正 整数 x 末尾部分是 s (换句话说,s 是 x 的 后缀),且 x 中的每个数位至多是 limit ,那么我们称 x 是 强大的 。 请你返回区间 [start..finish] 内强大整数的 总数目 。 如果一个字符串 x 是 y 中某个下标开始(包括 0 ),到下标为 y.length - 1 结束的子字符串,那么我们称 x 是 y 的一个后缀。比方说,25 …
leetcode.com 2025-04-10
🔴2999.count-the-number-of-powerful-integers
🏷️ Tags
#math #string #dynamic_programming
🔴2999.count-the-number-of-powerful-integers
🏷️ Tags
#math #string #dynamic_programming
Telegraph
count-the-number-of-powerful-integers
You are given three integers start, finish, and limit. You are also given a 0-indexed string s representing a positive integer. A positive integer x is called powerful if it ends with s (in other words, s is a suffix of x) and each digit in x is at most limit.…
leetcode.cn 2025-04-12
🔴3272.find-the-count-of-good-integers
🏷️ Tags
#hash_table #math #combinatorics #enumeration
🔴3272.find-the-count-of-good-integers
🏷️ Tags
#hash_table #math #combinatorics #enumeration
Telegraph
find-the-count-of-good-integers
给你两个 正 整数 n 和 k 。 如果一个整数 x 满足以下条件,那么它被称为 k 回文 整数 。
leetcode.com 2025-04-12
🔴3272.find-the-count-of-good-integers
🏷️ Tags
#hash_table #math #combinatorics #enumeration
🔴3272.find-the-count-of-good-integers
🏷️ Tags
#hash_table #math #combinatorics #enumeration
Telegraph
find-the-count-of-good-integers
You are given two positive integers n and k. An integer x is called k-palindromic if:
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.cn 2025-04-16
🟡2537.count-the-number-of-good-subarrays
🏷️ Tags
#array #hash_table #sliding_window
🟡2537.count-the-number-of-good-subarrays
🏷️ Tags
#array #hash_table #sliding_window
Telegraph
count-the-number-of-good-subarrays
给你一个整数数组 nums 和一个整数 k ,请你返回 nums 中 好 子数组的数目。 一个子数组 arr 如果有 至少 k 对下标 (i, j) 满足 i < j 且 arr[i] == arr[j] ,那么称它是一个 好 子数组。 子数组 是原数组中一段连续 非空 的元素序列。 示例 1: 输入:nums = [1,1,1,1,1], k = 10 输出:1 解释:唯一的好子数组是这个数组本身。 示例 2: 输入:nums = [3,1,4,3,2,2,4], k = 2 输出:4 解释:总共有…