puzzle algorithms


  • 100 doors problem

    Puzzle: There are 100 doors in a long hallway. They are all closed. The first time you walk by each door, you open it. The second time around, you close every second door (since they are all opened). On the third pass you stop at every third door and ...

  • 99 bottles problem

    # 99 Bottles of Beer # ## Puzzle: ## You must print the lyric of the song as follows: ``` 99 bottles of beer on the wall, 99 bottles of beer. Take one down and pass it around, 98 bottles of beer on the wall. 98 bottles of beer on the wall, 98 ...

  • einstein puzzle

    The zebra puzzle is a well-known logic puzzle. It is often called Einstein's Puzzle or Einstein's Riddle because it is said to have been invented by Albert Einstein as a boy. It is often claimed that only 2% of the population can solve it. The ...