This situation has a especial deal with power of two. Every time that the number of participants (N) is a power of two, the first element in such round will be the remaining of the entire process. Therefore, if we go around taking every other elements out until the remaining number is a power of two, the first element of this round will become the remaining person.
Log in or sign up for Devpost to join the conversation.