ComedyWire Challenge

An app for destroying chairs! Built atop ReactJS and Redux.

Instructions:

  • Download Repo
  • cd into the downloaded directory
  • run npm i
  • Allow installation finish
  • run npm start
This app launches under a development environment by default. Build script for production is WIP.

Original Task This App Solves:

Take a second to imagine that you are in a room with 100 chairs arranged in a circle. These chairs are numbered sequentially from One to One Hundred. At some point in time, the person in chair #1 will be told to leave the room. The person in chair #2 will be skipped, and the person in chair #3 will be told to leave. Next to go is person in chair #6. In other words, 1 person will be skipped initially, and then 2, 3, 4.. and so on. This pattern of skipping will keep going around the circle until there is only one person remaining- The survivor! Note that each chair is removed when the person leaves the room.

Write an HTML page using Javascript/Typescript and Angular (or React/Redux) to visualize the disappearing chairs and figure out which chair the survivor is sitting in. Please send me the answer and your working code.

Bonus:

  1. Make the number of chairs configurable. For instance, what happens if there are 200 chairs. Provide an option for the user to input the number of chairs