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…