Goodness Over Good
You are given: - two arrays $A$ and $B$, each consisting of $N$ positive integers; - a positive integer $K$. For a positive integer $X$, we say a set of indices $\{i_1, i_2, i_3, \ldots, i_m\}$ (where $1 \leq i_j, m \leq N$) to be *X-good* if: $(A_{i_1}$ $|$ $A_{i_2}$ $|$ $A_{i_3}$ $|$ $\ldots$ $|$ $A_{i_m}) \leq X$, where $|$ denotes the [bitwise or operation](https://en.wikipedia.org/wiki/Bi
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.
Sign in to chat with the tutor and save your progress.
Sign in to start