You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 in a fixed direction.
The task is to choose the safe place in the circle so that when you perform these operations starting from 1st place in the circle, you are the last one remaining and survive.
Input:
n = 3 k = 2
Output: 3
The text was updated successfully, but these errors were encountered:
Hi,
I have a good understanding of C++ STL. I am interested to solve this problem. Kindly, assign this issue to me. @Ankit152
Regards,
Saptarshi Mandal
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 in a fixed direction.
The task is to choose the safe place in the circle so that when you perform these operations starting from 1st place in the circle, you are the last one remaining and survive.
Input:
n = 3 k = 2
Output: 3
The text was updated successfully, but these errors were encountered: