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

8 lines
614 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Pass doors
Puzzle from the [rendezvous with cassidoo](https://buttondown.email/cassidoo/archive/i-never-regretted-what-i-turned-down-angela/) 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