Answer must be in C++
The problem is known as the Josephus problem and postulates agroup of people of size N are standing in a circle waiting to beeliminated. Counting begins at a specified point in the circle andproceeds around the circle in a specified direction. After aspecified number of M people are skipped, the next person iseliminated. The procedure is repeated with the remaining people,starting with the next person, going in the same direction andskipping the same number of people, until only one personremains.
For example, suppose that M = 3 and there are N = 5 people namedA, B, C,
PayPal Gateway not configured
PayPal Gateway not configured