GUVI
Back

find the survival person

Created 3 years ago
29 Views
2 Comments
Dharun-73mz
@Dharun-73mz
Dharun-73mz
@Dharun-73mzProfile is locked. Login

ind the man who will survive. There is a scenario that only one person will survive. ‘N’ person will stand in a circle. Initially first person will be holding the gun. You are given with number ‘k’. The person who is holding the gun has to count to ‘k’ starting from him and shoot the person at which k ends and then pass the gun to next alive person. Your task is to find the place where you will survive. Input Description: Two numbers – ‘N’ and ‘k’ Output Description: Find the place where you will be safe (indexing at 1) Sample Input : 2 1 Sample Output : 2

plz explain this que with another sample input and output.

Comments (2)
Please login to comment.
 
Powered by habitate.io Habitate