You have 100 doors in a row that are initially closed. You make 100 passes by the door and change it’s status i.e (you make the closed door open and the open door closed). After the first pass
you visit every 2nd door(i.2,4,6,8…) and in the next pass you visit every 3rd door and so on.
After all the pass which doors are closed and which are open.

To understand the solution let’s take an example. let us take the door number 15. so 15 will divisors as 1&15 and 3&5. So after this pass it will come back to it’s original position because 1 will open,3 will close,5 will open and 15 will close.So the door will remain in it’s original state. But what about the door 25. it has 1&25 and 5&5 as it’s divisors. But since 5 will occur only once so after all the passes 25 will be open. So this means that all those which are perfect squares will be open and rest will be closed.