Light More Light, UVa — 10110
Try it yourself on UVa. It’s Fun!
This problem has also been part of the programming challenges on the Algorithm Design Manual’s chapter 2.
The premise of the problem can be chalked out like this way:
- A guy goes along corridor N times which have N bulbs
- Every time he goes along the corridor he toggles the switch of certain bulbs based on certain condition
- We have to determine the state of the last bulb i.e. Nth bulb.