leetcode.cn 2025-03-07
🟡2597.the-number-of-beautiful-subsets
🏷️ Tags
#array #hash_table #math #dynamic_programming #backtracking #combinatorics #sorting
🟡2597.the-number-of-beautiful-subsets
🏷️ Tags
#array #hash_table #math #dynamic_programming #backtracking #combinatorics #sorting
Telegraph
the-number-of-beautiful-subsets
给你一个由正整数组成的数组 nums 和一个 正 整数 k 。 如果 nums 的子集中,任意两个整数的绝对差均不等于 k ,则认为该子数组是一个 美丽 子集。 返回数组 nums 中 非空 且 美丽 的子集数目。 nums 的子集定义为:可以经由 nums 删除某些元素(也可能不删除)得到的一个数组。只有在删除元素时选择的索引不同的情况下,两个子集才会被视作是不同的子集。 示例 1: 输入:nums = [2,4,6], k = 2 输出:4 解释:数组 nums 中的美丽子集有:[2], [4]…
leetcode.cn 2025-04-05
🟢1863.sum-of-all-subset-xor-totals
🏷️ Tags
#bit_manipulation #array #math #backtracking #combinatorics #enumeration
🟢1863.sum-of-all-subset-xor-totals
🏷️ Tags
#bit_manipulation #array #math #backtracking #combinatorics #enumeration
Telegraph
sum-of-all-subset-xor-totals
一个数组的 异或总和 定义为数组中所有元素按位 XOR 的结果;如果数组为 空 ,则异或总和为 0 。
leetcode.com 2025-04-05
🟢1863.sum-of-all-subset-xor-totals
🏷️ Tags
#bit_manipulation #array #math #backtracking #combinatorics #enumeration
🟢1863.sum-of-all-subset-xor-totals
🏷️ Tags
#bit_manipulation #array #math #backtracking #combinatorics #enumeration
Telegraph
sum-of-all-subset-xor-totals
The XOR total of an array is defined as the bitwise XOR of all its elements, or 0 if the array is empty.
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-22
🔴2338.count-the-number-of-ideal-arrays
🏷️ Tags
#math #dynamic_programming #combinatorics #number_theory
🔴2338.count-the-number-of-ideal-arrays
🏷️ Tags
#math #dynamic_programming #combinatorics #number_theory
Telegraph
count-the-number-of-ideal-arrays
给你两个整数 n 和 maxValue ,用于描述一个 理想数组 。 对于下标从 0 开始、长度为 n 的整数数组 arr ,如果满足以下条件,则认为该数组是一个 理想数组 :
leetcode.com 2025-04-22
🔴2338.count-the-number-of-ideal-arrays
🏷️ Tags
#math #dynamic_programming #combinatorics #number_theory
🔴2338.count-the-number-of-ideal-arrays
🏷️ Tags
#math #dynamic_programming #combinatorics #number_theory
Telegraph
count-the-number-of-ideal-arrays
You are given two integers n and maxValue, which are used to describe an ideal array. A 0-indexed integer array arr of length n is considered ideal if the following conditions hold:
leetcode.cn 2025-05-09
🔴3343.count-number-of-balanced-permutations
🏷️ Tags
#math #string #dynamic_programming #combinatorics
🔴3343.count-number-of-balanced-permutations
🏷️ Tags
#math #string #dynamic_programming #combinatorics
Telegraph
count-number-of-balanced-permutations
给你一个字符串 num 。如果一个数字字符串的奇数位下标的数字之和与偶数位下标的数字之和相等,那么我们称这个数字字符串是 平衡的 。
leetcode.com 2025-05-09
🔴3343.count-number-of-balanced-permutations
🏷️ Tags
#math #string #dynamic_programming #combinatorics
🔴3343.count-number-of-balanced-permutations
🏷️ Tags
#math #string #dynamic_programming #combinatorics
Telegraph
count-number-of-balanced-permutations
You are given a string num. A string of digits is called balanced if the sum of the digits at even indices is equal to the sum of the digits at odd indices.
leetcode.cn 2025-06-01
🟡2929.distribute-candies-among-children-ii
🏷️ Tags
#math #combinatorics #enumeration
🟡2929.distribute-candies-among-children-ii
🏷️ Tags
#math #combinatorics #enumeration
Telegraph
distribute-candies-among-children-ii
给你两个正整数 n 和 limit 。 请你将 n 颗糖果分给 3 位小朋友,确保没有任何小朋友得到超过 limit 颗糖果,请你返回满足此条件下的 总方案数 。 示例 1: 输入:n = 5, limit = 2 输出:3 解释:总共有 3 种方法分配 5 颗糖果,且每位小朋友的糖果数不超过 2 :(1, 2, 2) ,(2, 1, 2) 和 (2, 2, 1) 。 示例 2: 输入:n = 3, limit = 3 输出:10 解释:总共有 10 种方法分配 3 颗糖果,且每位小朋友的糖果数不超过…
leetcode.com 2025-06-01
🟡2929.distribute-candies-among-children-ii
🏷️ Tags
#math #combinatorics #enumeration
🟡2929.distribute-candies-among-children-ii
🏷️ Tags
#math #combinatorics #enumeration
Telegraph
distribute-candies-among-children-ii
You are given two positive integers n and limit. Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies. Example 1: Input: n = 5, limit = 2 Output: 3 Explanation: There are 3 ways to distribute…
leetcode.cn 2025-06-17
🔴3405.count-the-number-of-arrays-with-k-matching-adjacent-elements
🏷️ Tags
#math #combinatorics
🔴3405.count-the-number-of-arrays-with-k-matching-adjacent-elements
🏷️ Tags
#math #combinatorics
Telegraph
count-the-number-of-arrays-with-k-matching-adjacent-elements
给你三个整数 n ,m ,k 。长度为 n 的 好数组 arr 定义如下:
leetcode.com 2025-06-17
🔴3405.count-the-number-of-arrays-with-k-matching-adjacent-elements
🏷️ Tags
#math #combinatorics
🔴3405.count-the-number-of-arrays-with-k-matching-adjacent-elements
🏷️ Tags
#math #combinatorics
Telegraph
count-the-number-of-arrays-with-k-matching-adjacent-elements
You are given three integers n, m, k. A good array arr of size n is defined as follows:
leetcode.cn 2025-09-30
🟡2221.find-triangular-sum-of-an-array
🏷️ Tags
#array #math #combinatorics #simulation
🟡2221.find-triangular-sum-of-an-array
🏷️ Tags
#array #math #combinatorics #simulation
Telegraph
find-triangular-sum-of-an-array
给你一个下标从 0 开始的整数数组 nums ,其中 nums[i] 是 0 到 9 之间(两者都包含)的一个数字。 nums 的 三角和 是执行以下操作以后最后剩下元素的值:
leetcode.com 2025-09-30
🟡2221.find-triangular-sum-of-an-array
🏷️ Tags
#array #math #combinatorics #simulation
🟡2221.find-triangular-sum-of-an-array
🏷️ Tags
#array #math #combinatorics #simulation
Telegraph
find-triangular-sum-of-an-array
You are given a 0-indexed integer array nums, where nums[i] is a digit between 0 and 9 (inclusive). The triangular sum of nums is the value of the only element present in nums after the following process terminates:
leetcode.cn 2025-10-12
🔴3539.find-sum-of-array-product-of-magical-sequences
🏷️ Tags
#bit_manipulation #array #math #dynamic_programming #bitmask #combinatorics
🔴3539.find-sum-of-array-product-of-magical-sequences
🏷️ Tags
#bit_manipulation #array #math #dynamic_programming #bitmask #combinatorics
Telegraph
find-sum-of-array-product-of-magical-sequences
给你两个整数 M 和 K,和一个整数数组 nums。
leetcode.com 2025-10-12
🔴3539.find-sum-of-array-product-of-magical-sequences
🏷️ Tags
#bit_manipulation #array #math #dynamic_programming #bitmask #combinatorics
🔴3539.find-sum-of-array-product-of-magical-sequences
🏷️ Tags
#bit_manipulation #array #math #dynamic_programming #bitmask #combinatorics
Telegraph
find-sum-of-array-product-of-magical-sequences
You are given two integers, m and k, and an integer array nums.
leetcode.cn 2025-10-23
🟢3461.check-if-digits-are-equal-in-string-after-operations-i
🏷️ Tags
#math #string #combinatorics #number_theory #simulation
🟢3461.check-if-digits-are-equal-in-string-after-operations-i
🏷️ Tags
#math #string #combinatorics #number_theory #simulation
Telegraph
check-if-digits-are-equal-in-string-after-operations-i
给你一个由数字组成的字符串 s 。重复执行以下操作,直到字符串恰好包含 两个 数字:
leetcode.com 2025-10-23
🟢3461.check-if-digits-are-equal-in-string-after-operations-i
🏷️ Tags
#math #string #combinatorics #number_theory #simulation
🟢3461.check-if-digits-are-equal-in-string-after-operations-i
🏷️ Tags
#math #string #combinatorics #number_theory #simulation
Telegraph
check-if-digits-are-equal-in-string-after-operations-i
You are given a string s consisting of digits. Perform the following operation repeatedly until the string has exactly two digits:
❤1