Problem 3171 · Hard

Find Subarray With Bitwise OR Closest to K

Each end index has only about log(V) distinct OR values, so track those and compare each with k.

Open the interactive visualisation