What it does
It can save your life. That is, if you find yourself in the situation described in the main page. Other than that, it solves a well know mathematical problem called Josephu's Problem.
How we built it
First, we had to understand the mathematical pattern behind the problem. After analysing the values of the last remaining position from 1 to 20, we figured it out. It is a simple divergent series that adds two at every step foward and that resets it self every power of 2. With that we can say that the last remaining position is 1 plus twice the number of steps between the input value and the closest lower power of 2 plus. This is not by any means a rigorous proof, but we tested it thoroughly and we are very confidente that is works.
Last Remaining Position = 2(N-ClosestLowerPower2) + 1
Challenges we ran into
Finding a general solution, instead of creating an algorithm to simulate the problem, was particularly hard because it takes much higher levels of abstract thinking.
Accomplishments that we're proud of
We are proud to present this solution in a clean layout with a very concise explanation of the logic behind it.
What we learned
It helped us learn how to create responsive design that can ajust it self to every screen size and keep the user experience unaltered.
What's next for, Last one remaining in the circle - Josephu's Problem
Besides saving more lifes? We could generalize for bigger than 2 criteria.



Log in or sign up for Devpost to join the conversation.