leetcode.com 2025-07-31
🟡898.bitwise-ors-of-subarrays
🏷️ Tags
#bit_manipulation #array #dynamic_programming
🟡898.bitwise-ors-of-subarrays
🏷️ Tags
#bit_manipulation #array #dynamic_programming
Telegraph
bitwise-ors-of-subarrays
Given an integer array arr, return the number of distinct bitwise ORs of all the non-empty subarrays of arr. The bitwise OR of a subarray is the bitwise OR of each integer in the subarray. The bitwise OR of a subarray of one integer is that integer. A subarray…
leetcode.cn 2025-08-11
🟡2438.range-product-queries-of-powers
🏷️ Tags
#bit_manipulation #array #prefix_sum
🟡2438.range-product-queries-of-powers
🏷️ Tags
#bit_manipulation #array #prefix_sum
Telegraph
range-product-queries-of-powers
给你一个正整数 n ,你需要找到一个下标从 0 开始的数组 powers ,它包含 最少 数目的 2 的幂,且它们的和为 n 。powers 数组是 非递减 顺序的。根据前面描述,构造 powers 数组的方法是唯一的。 同时给你一个下标从 0 开始的二维整数数组 queries ,其中 queries[i] = [lefti, righti] ,其中 queries[i] 表示请你求出满足 lefti <= j <= righti 的所有 powers[j] 的乘积。 请你返回一个数组 answers…
leetcode.com 2025-08-11
🟡2438.range-product-queries-of-powers
🏷️ Tags
#bit_manipulation #array #prefix_sum
🟡2438.range-product-queries-of-powers
🏷️ Tags
#bit_manipulation #array #prefix_sum
Telegraph
range-product-queries-of-powers
Given a positive integer n, there exists a 0-indexed array called powers, composed of the minimum number of powers of 2 that sum to n. The array is sorted in non-decreasing order, and there is only one way to form the array. You are also given a 0-indexed…
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-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.