Updated 11 May 2020
N people standing in a circle. 1st person has a sword. He kills the next person (i.e. No. 2) and gives the sword to the next (i.e. No. 3). All people do the same until only one of them survives. Which number survives at the last?
Two alternative solutions are provided here.
Arpan Gayen (2021). MathExample(N person standing in a circle with only 1 sword) (https://www.mathworks.com/matlabcentral/fileexchange/75475-mathexample-n-person-standing-in-a-circle-with-only-1-sword), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!