Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Josephus problem #818

Open
vikashpatel07 opened this issue Oct 25, 2021 · 7 comments
Open

Josephus problem #818

vikashpatel07 opened this issue Oct 25, 2021 · 7 comments

Comments

@vikashpatel07
Copy link

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
Copy link

please assign me this problem .

@lavakush07
Copy link

Please can you assign me this problem !!

@anish853
Copy link

Please can you assign this problem!!

@sujeettomar60615
Copy link

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

@init-pushu
Copy link

Hello Sir! Can you assign this problem to me?

@ChandniJha630
Copy link

i can solve this issue please assign me this problem

@akshitajaiswal2908
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants