100 Lockers

There are n lockers in a hallway, numbered from 1 to n. Initially, all lockers are closed.

Perform n rounds of operations. In round i, toggle every locker whose number is a multiple of i:...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: