Bulbs
CodeChefOpen on judge ↗
There are n bulbs in a row lighted during a marriage ceremony. A mischievous boy was passing from nearby when he had a naughty idea of breaking the bulbs. To make it interesting he does so in a pattern. He decides to smash every second lighted bulb on his first traversal, every third lighted bulb on his second traversal and so on. Getting exhausted at end he found that some of the bulbs remain luc
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