There are 2019 people playing a game. They stand in a line, and they are labeled No.1 to No.2019 from the front to the back of the line. In each round, the first person of the line says 1, then the second person says 2, ... when the last person of the line says his number, it comes back to the first person. It goes on and on, until one of them says 2019, then that person is eliminated. For example, in the first, second, third, fourth round, No. 2019, No. 1, No. 3, No. 5 are eliminated respectively.
There is only one person left when they have played for 2018 rounds. What is the number of the person?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
Ima beast this took less than a second to spit out the answer also it took a bit longer than that to write the code Pure Javascript put it in a HTML document and run and the answer before ur eyes I prefer document.write(stuff) to console.log(stuff) because the consoles always crowded up with nonsense