Available question text
Count how many distinct integers appear as the bitwise OR of any non-empty contiguous subarray of arr.
Key insight: bitwise OR only accumulates bits so the number of distinct ORs ending at each position is bounded (≈bit-width of numbers), allowing an efficient iterative set-based accumulation for n up to 5·10^4 and values ≤ 10^9.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 2 records
Amazon
Leetcode 898. Bitwise ORs of Subarrays
Reported Sep 1, 2026 · 1 source report
JUNIOR
Source snapshot: Nov 12, 2026
View sourceMicrosoft
Leetcode 898. Bitwise ORs of Subarrays
Reported Jan 26, 2026 · 1 source report
SENIOR
Source snapshot: Nov 12, 2026
View source