count lamps, numbered 1 to count, all switched off. There are count rounds: in round k every lamp whose number is divisible by k is toggled (a lit lamp goes off, a dark one comes on). So round 1 turns every lamp on, and the last round toggles only lamp count.
Return how many lamps are lit after all the rounds.count=5 → 2
After round 1 all five are on. Round 2 turns off 2 and 4, round 3 turns off 3, round 4 turns 4 back on, round 5 turns off 5. Lamps 1 and 4 stay lit.
count=0 → 0
There are no lamps, so nothing is lit.
count=10 → 3
count=5
2
Run checks the first 3 tests in your browser. Submit checks all 88 tests on the server, hidden ones included.