Switches
CodeChefOpen on judge ↗
Chef is given the responsibility to switch on all the lights in the city streets. There are n number of switches one for each light, It is a boring task to switch on and off every switch. So they fitted a new special switch, that inverts the state of every switch(Switches On if they were off and Off if they were on). This special switch is all we need to toggle the lights for the whole city. But s
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