TAbhay / Hactoberfest-2021

Make your first PR! ~ A beginner friendly repository made specifically for open source beginners. Add your profile, a blog or any program under any language (it can be anything from a hello-world program to a complex data structure algorithm) or update the existing one. Just make sure to add the file under the correct directory. Happy hacking!
122 stars 497 forks source link

Josephus problem #818

Open vikashpatel07 opened 2 years ago

vikashpatel07 commented 2 years ago

There are n people standing in a circle waiting to be executed. The counting out begins at some point in the circle and proceeds around the circle in a fixed direction. In each step, a certain number of people are skipped and the next person is executed. The elimination proceeds around the circle (which is becoming smaller and smaller as the executed people are removed), until only the last person remains, who is given freedom. 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. The task is to choose the place in the initial circle so that you are the last one remaining and so survive. For example, if n = 5 and k = 2, then the safe position is 3. Firstly, the person at position 2 is killed, then person at position 4 is killed, then person at position 1 is killed. Finally, the person at position 5 is killed. So the person at position 3 survives. If n = 7 and k = 3, then the safe position is 4. The persons at positions 3, 6, 2, 7, 5, 1 are killed in order, and person at position 4 survives.

Kindlly assign this issue to me......

sksinghl498 commented 2 years ago

please assign me this problem .

lavakush07 commented 2 years ago

Please can you assign me this problem !!

anish853 commented 1 year ago

Please can you assign this problem!!

sujeettomar60615 commented 1 year ago

hey @vikashpatel07 can you assign this task to me in C++;

init-pushu commented 1 year ago

Hello Sir! Can you assign this problem to me?

ChandniJha630 commented 1 year ago

i can solve this issue please assign me this problem

akshitajaiswal2908 commented 8 months ago

Hello Sir/Mam , Can you please assign me this issue ??