puzzles/passdoors/README.md
Zoé Cassiopée Gauthier 7e4f02547b Initial commit
2024-04-02 17:01:09 -04:00

614 B
Raw Blame History

Pass doors

Puzzle from the rendezvous with cassidoo newsletter from October 16th, 2022.

Lets say you have n doors that start out as closed. With the first pass across the doors, you toggle every door open. With the second pass, you toggle every second door. With the third, every third door, and so on. Write a function that takes in an integer numberOfPasses, and returns how many doors are open after the number of passes.

Solution posted at https://gist.github.com/zoeisnowooze/3fd5b2f592a82a1b79be386ff3c53c3e