leetcode.cn 2025-09-05
🟡2749.minimum-operations-to-make-the-integer-zero
🏷️ Tags
#bit_manipulation #brainteaser #enumeration
🟡2749.minimum-operations-to-make-the-integer-zero
🏷️ Tags
#bit_manipulation #brainteaser #enumeration
Telegraph
minimum-operations-to-make-the-integer-zero
给你两个整数:num1 和 num2 。 在一步操作中,你需要从范围 [0, 60] 中选出一个整数 i ,并从 num1 减去 2i + num2 。 请你计算,要想使 num1 等于 0 需要执行的最少操作数,并以整数形式返回。 如果无法使 num1 等于 0 ,返回 -1 。 示例 1: 输入:num1 = 3, num2 = -2 输出:3 解释:可以执行下述步骤使 3 等于 0 : - 选择 i = 2 ,并从 3 减去 22 + (-2) ,num1 = 3 - (4 + (-2)) =…
leetcode.com 2025-09-05
🟡2749.minimum-operations-to-make-the-integer-zero
🏷️ Tags
#bit_manipulation #brainteaser #enumeration
🟡2749.minimum-operations-to-make-the-integer-zero
🏷️ Tags
#bit_manipulation #brainteaser #enumeration
Telegraph
minimum-operations-to-make-the-integer-zero
You are given two integers num1 and num2. In one operation, you can choose integer i in the range [0, 60] and subtract 2i + num2 from num1. Return the integer denoting the minimum number of operations needed to make num1 equal to 0. If it is impossible to…
leetcode.cn 2025-10-19
🟡1625.lexicographically-smallest-string-after-applying-operations
🏷️ Tags
#depth_first_search #breadth_first_search #string #enumeration
🟡1625.lexicographically-smallest-string-after-applying-operations
🏷️ Tags
#depth_first_search #breadth_first_search #string #enumeration
Telegraph
lexicographically-smallest-string-after-applying-operations
给你一个字符串 s 以及两个整数 a 和 b 。其中,字符串 s 的长度为偶数,且仅由数字 0 到 9 组成。 你可以在 s 上按任意顺序多次执行下面两个操作之一:
leetcode.com 2025-10-19
🟡1625.lexicographically-smallest-string-after-applying-operations
🏷️ Tags
#depth_first_search #breadth_first_search #string #enumeration
🟡1625.lexicographically-smallest-string-after-applying-operations
🏷️ Tags
#depth_first_search #breadth_first_search #string #enumeration
Telegraph
lexicographically-smallest-string-after-applying-operations
You are given a string s of even length consisting of digits from 0 to 9, and two integers a and b. You can apply either of the following two operations any number of times and in any order on s:
leetcode.cn 2025-10-24
🟡2048.next-greater-numerically-balanced-number
🏷️ Tags
#hash_table #math #backtracking #counting #enumeration
🟡2048.next-greater-numerically-balanced-number
🏷️ Tags
#hash_table #math #backtracking #counting #enumeration
Telegraph
next-greater-numerically-balanced-number
如果整数 x 满足:对于每个数位 d ,这个数位 恰好 在 x 中出现 d 次。那么整数 x 就是一个 数值平衡数 。 给你一个整数 n ,请你返回 严格大于 n 的 最小数值平衡数 。 示例 1: 输入:n = 1 输出:22 解释: 22 是一个数值平衡数,因为: - 数字 2 出现 2 次 这也是严格大于 1 的最小数值平衡数。 示例 2: 输入:n = 1000 输出:1333 解释: 1333 是一个数值平衡数,因为: - 数字 1 出现 1 次。 - 数字 3 出现 3 次。 这也是严格大于…
leetcode.com 2025-10-24
🟡2048.next-greater-numerically-balanced-number
🏷️ Tags
#hash_table #math #backtracking #counting #enumeration
🟡2048.next-greater-numerically-balanced-number
🏷️ Tags
#hash_table #math #backtracking #counting #enumeration
Telegraph
next-greater-numerically-balanced-number
An integer x is numerically balanced if for every digit d in the number x, there are exactly d occurrences of that digit in x. Given an integer n, return the smallest numerically balanced number strictly greater than n. Example 1: Input: n = 1 Output: 22…
leetcode.cn 2025-11-15
🟡3234.count-the-number-of-substrings-with-dominant-ones
🏷️ Tags
#string #enumeration #sliding_window
🟡3234.count-the-number-of-substrings-with-dominant-ones
🏷️ Tags
#string #enumeration #sliding_window
Telegraph
count-the-number-of-substrings-with-dominant-ones
给你一个二进制字符串 s。 请你统计并返回其中 1 显著 的 子字符串 的数量。 如果字符串中 1 的数量 大于或等于 0 的数量的 平方,则认为该字符串是一个 1 显著 的字符串 。 示例 1: 输入:s = "00011" 输出:5 解释: 1 显著的子字符串如下表所示。
leetcode.com 2025-11-15
🟡3234.count-the-number-of-substrings-with-dominant-ones
🏷️ Tags
#string #enumeration #sliding_window
🟡3234.count-the-number-of-substrings-with-dominant-ones
🏷️ Tags
#string #enumeration #sliding_window
Telegraph
count-the-number-of-substrings-with-dominant-ones
You are given a binary string s. Return the number of substrings with dominant ones. A string has dominant ones if the number of ones in the string is greater than or equal to the square of the number of zeros in the string. Example 1: Input: s = "00011"…
leetcode.cn 2026-01-16
🟡2975.maximum-square-area-by-removing-fences-from-a-field
🏷️ Tags
#array #hash_table #enumeration
🟡2975.maximum-square-area-by-removing-fences-from-a-field
🏷️ Tags
#array #hash_table #enumeration
Telegraph
maximum-square-area-by-removing-fences-from-a-field
有一个大型的 (m - 1) x (n - 1) 矩形田地,其两个对角分别是 (1, 1) 和 (m, n) ,田地内部有一些水平栅栏和垂直栅栏,分别由数组 hFences 和 vFences 给出。 水平栅栏为坐标 (hFences[i], 1) 到 (hFences[i], n),垂直栅栏为坐标 (1, vFences[i]) 到 (m, vFences[i]) 。 返回通过 移除 一些栅栏(可能不移除)所能形成的最大面积的 正方形 田地的面积,或者如果无法形成正方形田地则返回 -1。 由于答案可能很大,所以请返回结果对…
leetcode.com 2026-01-16
🟡2975.maximum-square-area-by-removing-fences-from-a-field
🏷️ Tags
#array #hash_table #enumeration
🟡2975.maximum-square-area-by-removing-fences-from-a-field
🏷️ Tags
#array #hash_table #enumeration
Telegraph
maximum-square-area-by-removing-fences-from-a-field
There is a large (m - 1) x (n - 1) rectangular field with corners at (1, 1) and (m, n) containing some horizontal and vertical fences given in arrays hFences and vFences respectively. Horizontal fences are from the coordinates (hFences[i], 1) to (hFences[i]…
leetcode.cn 2026-02-01
🟢3010.divide-an-array-into-subarrays-with-minimum-cost-i
🏷️ Tags
#array #enumeration #sorting
🟢3010.divide-an-array-into-subarrays-with-minimum-cost-i
🏷️ Tags
#array #enumeration #sorting
Telegraph
divide-an-array-into-subarrays-with-minimum-cost-i
给你一个长度为 n 的整数数组 nums 。 一个数组的 代价 是它的 第一个 元素。比方说,[1,2,3] 的代价是 1 ,[3,4,1] 的代价是 3 。 你需要将 nums 分成 3 个 连续且没有交集 的子数组。 请你返回这些子数组的 最小 代价 总和 。 示例 1: 输入:nums = [1,2,3,12] 输出:6 解释:最佳分割成 3 个子数组的方案是:[1] ,[2] 和 [3,12] ,总代价为 1 + 2 + 3 = 6 。 其他得到 3 个子数组的方案是: - [1] ,[2,3]…
leetcode.com 2026-02-01
🟢3010.divide-an-array-into-subarrays-with-minimum-cost-i
🏷️ Tags
#array #enumeration #sorting
🟢3010.divide-an-array-into-subarrays-with-minimum-cost-i
🏷️ Tags
#array #enumeration #sorting
Telegraph
divide-an-array-into-subarrays-with-minimum-cost-i
You are given an array of integers nums of length n. The cost of an array is the value of its first element. For example, the cost of [1,2,3] is 1 while the cost of [3,4,1] is 3. You need to divide nums into 3 disjoint contiguous subarrays. Return the minimum…
leetcode.cn 2026-02-12
🟡3713.longest-balanced-substring-i
🏷️ Tags
#hash_table #string #counting #enumeration
🟡3713.longest-balanced-substring-i
🏷️ Tags
#hash_table #string #counting #enumeration
Telegraph
longest-balanced-substring-i
给你一个由小写英文字母组成的字符串 s。
leetcode.com 2026-02-12
🟡3713.longest-balanced-substring-i
🏷️ Tags
#hash_table #string #counting #enumeration
🟡3713.longest-balanced-substring-i
🏷️ Tags
#hash_table #string #counting #enumeration
Telegraph
longest-balanced-substring-i
You are given a string s consisting of lowercase English letters. A substring of s is called balanced if all distinct characters in the substring appear the same number of times. Return the length of the longest balanced substring of s. Example 1: Input:…
leetcode.cn 2026-03-25
🟡3546.equal-sum-grid-partition-i
🏷️ Tags
#array #enumeration #matrix #prefix_sum
🟡3546.equal-sum-grid-partition-i
🏷️ Tags
#array #enumeration #matrix #prefix_sum
Telegraph
equal-sum-grid-partition-i
给你一个由正整数组成的 m x n 矩阵 grid。你的任务是判断是否可以通过 一条水平或一条垂直分割线 将矩阵分割成两部分,使得:
leetcode.com 2026-03-25
🟡3546.equal-sum-grid-partition-i
🏷️ Tags
#array #enumeration #matrix #prefix_sum
🟡3546.equal-sum-grid-partition-i
🏷️ Tags
#array #enumeration #matrix #prefix_sum
Telegraph
equal-sum-grid-partition-i
You are given an m x n matrix grid of positive integers. Your task is to determine if it is possible to make either one horizontal or one vertical cut on the grid such that:
leetcode.cn 2026-03-26
🔴3548.equal-sum-grid-partition-ii
🏷️ Tags
#array #hash_table #enumeration #matrix #prefix_sum
🔴3548.equal-sum-grid-partition-ii
🏷️ Tags
#array #hash_table #enumeration #matrix #prefix_sum
Telegraph
equal-sum-grid-partition-ii
给你一个由正整数组成的 m x n 矩阵 grid。你的任务是判断是否可以通过 一条水平或一条垂直分割线 将矩阵分割成两部分,使得:
leetcode.com 2026-03-26
🔴3548.equal-sum-grid-partition-ii
🏷️ Tags
#array #hash_table #enumeration #matrix #prefix_sum
🔴3548.equal-sum-grid-partition-ii
🏷️ Tags
#array #hash_table #enumeration #matrix #prefix_sum
Telegraph
equal-sum-grid-partition-ii
You are given an m x n matrix grid of positive integers. Your task is to determine if it is possible to make either one horizontal or one vertical cut on the grid such that: