← All problemsSign in

Adjacent OR

CodeChefRating 2296Open on judge ↗

You are given $2$ **binary** arrays $A$ and $B$ of length $N$. Binary arrays means that $0 \le A_i, B_i \le 1$. Is it possible to convert $A$ to $B$ using the following operation as many times as you want: - Choose index $i$ such that $1 < i < N$ and change $A_i$ to $A_{i - 1} | A_{i + 1}$, where $|$ represents the [Bitwise OR Operator](https://en.wikipedia.org/wiki/Bitwise_operation#OR). Prin

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