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-09-06
🔴3495.minimum-operations-to-make-array-elements-zero
🏷️ Tags
#bit_manipulation #array #math
🔴3495.minimum-operations-to-make-array-elements-zero
🏷️ Tags
#bit_manipulation #array #math
Telegraph
minimum-operations-to-make-array-elements-zero
给你一个二维数组 queries,其中 queries[i] 形式为 [l, r]。每个 queries[i] 表示了一个元素范围从 l 到 r (包括 l 和 r )的整数数组 nums 。
leetcode.com 2025-09-06
🔴3495.minimum-operations-to-make-array-elements-zero
🏷️ Tags
#bit_manipulation #array #math
🔴3495.minimum-operations-to-make-array-elements-zero
🏷️ Tags
#bit_manipulation #array #math
Telegraph
minimum-operations-to-make-array-elements-zero
You are given a 2D array queries, where queries[i] is of the form [l, r]. Each queries[i] defines an array of integers nums consisting of elements ranging from l to r, both inclusive. In one operation, you can:
leetcode.cn 2025-09-09
🟡2327.number-of-people-aware-of-a-secret
🏷️ Tags
#queue #dynamic_programming #simulation
🟡2327.number-of-people-aware-of-a-secret
🏷️ Tags
#queue #dynamic_programming #simulation
Telegraph
number-of-people-aware-of-a-secret
在第 1 天,有一个人发现了一个秘密。 给你一个整数 delay ,表示每个人会在发现秘密后的 delay 天之后,每天 给一个新的人 分享 秘密。同时给你一个整数 forget ,表示每个人在发现秘密 forget 天之后会 忘记 这个秘密。一个人 不能 在忘记秘密那一天及之后的日子里分享秘密。 给你一个整数 n ,请你返回在第 n 天结束时,知道秘密的人数。由于答案可能会很大,请你将结果对 109 + 7 取余 后返回。 示例 1: 输入:n = 6, delay = 2, forget = 4…
leetcode.com 2025-09-09
🟡2327.number-of-people-aware-of-a-secret
🏷️ Tags
#queue #dynamic_programming #simulation
🟡2327.number-of-people-aware-of-a-secret
🏷️ Tags
#queue #dynamic_programming #simulation
Telegraph
number-of-people-aware-of-a-secret
On day 1, one person discovers a secret. You are given an integer delay, which means that each person will share the secret with a new person every day, starting from delay days after discovering the secret. You are also given an integer forget, which means…
leetcode.cn 2025-09-13
🟢3541.find-most-frequent-vowel-and-consonant
🏷️ Tags
#hash_table #string #counting
🟢3541.find-most-frequent-vowel-and-consonant
🏷️ Tags
#hash_table #string #counting
Telegraph
find-most-frequent-vowel-and-consonant
给你一个由小写英文字母('a' 到 'z')组成的字符串 s。你的任务是找出出现频率 最高 的元音('a'、'e'、'i'、'o'、'u' 中的一个)和出现频率最高的辅音(除元音以外的所有字母),并返回这两个频率之和。 注意:如果有多个元音或辅音具有相同的最高频率,可以任选其中一个。如果字符串中没有元音或没有辅音,则其频率视为 0。
leetcode.com 2025-09-13
🟢3541.find-most-frequent-vowel-and-consonant
🏷️ Tags
#hash_table #string #counting
🟢3541.find-most-frequent-vowel-and-consonant
🏷️ Tags
#hash_table #string #counting
Telegraph
find-most-frequent-vowel-and-consonant
You are given a string s consisting of lowercase English letters ('a' to 'z'). Your task is to: