Entain India interview question

Puzzle on 100 light bulbs Many questions on Java