Hactoberfest-2021 icon indicating copy to clipboard operation
Hactoberfest-2021 copied to clipboard

Josephus problem

Open vikashpatel07 opened this issue 3 years ago • 7 comments

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......

vikashpatel07 avatar Oct 25 '21 14:10 vikashpatel07

please assign me this problem .

sksinghl498 avatar Oct 26 '21 18:10 sksinghl498

Please can you assign me this problem !!

lavakush07 avatar Dec 12 '21 05:12 lavakush07

Please can you assign this problem!!

anish853 avatar Sep 30 '22 19:09 anish853

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

sujeettomar60615 avatar Oct 03 '22 21:10 sujeettomar60615

Hello Sir! Can you assign this problem to me?

init-pushu avatar Oct 11 '22 10:10 init-pushu

i can solve this issue please assign me this problem

ChandniJha630 avatar Oct 20 '22 04:10 ChandniJha630

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

akshitajaiswal2908 avatar Oct 12 '23 17:10 akshitajaiswal2908