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 解释:总共有…
leetcode.cn 2025-04-19
🟡2563.count-the-number-of-fair-pairs
🏷️ Tags
#array #two_pointers #binary_search #sorting
🟡2563.count-the-number-of-fair-pairs
🏷️ Tags
#array #two_pointers #binary_search #sorting
Telegraph
count-the-number-of-fair-pairs
给你一个下标从 0 开始、长度为 n 的整数数组 nums ,和两个整数 lower 和 upper ,返回 公平数对的数目 。 如果 (i, j) 数对满足以下情况,则认为它是一个 公平数对 :