← All problemsSign in

Light The Bulb

CodeChefRating 2464Open on judge ↗

Chef has a kitchen with a bulb and $N$ switches. The bulb will only light up if the $N$ switches are in a specific order, as given by a binary string $S$ of size $N$. In this binary string, `0` at the $i^{th}$ position represents that the $i^{th}$ switch is `OFF`, and `1` means that the switch is `ON`. Initially, Chef has the switches in the state represented by the binary string $T$ of length

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