amritansh22 / Data-Structures-and-Algorithms-in-cpp

This repository is in development phase and will soon provide you with c++ code of various data structures and algorithms
MIT License
366 stars 341 forks source link

The Josephus Problem #327

Closed Harshit812 closed 3 years ago

Harshit812 commented 3 years ago

I will write a recursive solution for this famous problem known as "Josephus Problem" . Problem is : There are n people standing in a circle . In each step, a certain number of people are skipped and the next person is executed (killed) . This process continues in the same direction till only 1 person is left who will be the winner . Given the total number of persons n and a number k which indicates that k-1 persons are skipped and kth person is killed in circle.

welcome[bot] commented 3 years ago

Thanks for opening your first issue here!