+ 8
##challenge## write codes for Finding solution to this mathematics problem
certain no.of people (say 10)standing on a circle. If first person has knife, he kill the second person and handover knife to third. now third person kill forth person this continues till only one of them survive what is the no.of that person ex:if there 5 people ,,,,then 1 kills 2, 3 kills 4, 5 kills 1, 3 kills 5. leaving third person survive #### if possible take no.of person from user input if 7 people then 7th person survive if 100 people then 73rd person survive
8 Réponses
+ 14
https://code.sololearn.com/cuZjxOyE6dMC/?ref=app
https://code.sololearn.com/Wu9VdBoMZsoX/?ref=app
https://code.sololearn.com/c3ftJpHozZa4/?ref=app
and many more...
Look up 'Josephus' in the codes ;)
+ 11
+ 6
Here's my C# implementation! ✌
Interesting challenge! I've included the gameplay visualization in my solution too. Enjoy~ ❤
https://code.sololearn.com/cZf5CJ5ZRsJi/?ref=app
+ 5
I don't like your challenge because we want peace in the world. Not people kill each other or something like that.
Peace ✌
+ 2
it's called josephus problem
+ 1
my answer for any no.of.peoples
https://code.sololearn.com/cPAE3hAmpBbM/?ref=app
0
try to write code , that answers for any number of peoples
not just for 100 peoples