← All problemsSign in

Special Subarray

You are given an array $A_1, A_2..., A_N$ consisting of $N$ integers. A subarray is special if the bitwise OR of the subarray is $2^K-1$ where $0 \leq K \leq 30$. Your goal is to determine the length of the longest special subarray. ### Input - The first line contains a single integer $N$. - The second line contains $N$ space-separated integers $A1$,$A2$,...,$AN$ ### Output Print a single line c

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start