Problem 3209 · Hard

Number of Subarrays With AND Value of K

For each end index, group the subarrays by their AND value; there are few distinct values, so counting stays small.

Open the interactive visualisation