Guest

There are 1000 people standing in a circle. they are numbered 1 to 1000. 2 is on the left of 1,3 is on the left of 2 and so on. Starting from 1, each person kills the person on the left. Who will be the last person standing

There are 1000 people standing in a circle. they are numbered 1 to 1000. 2 is on the left of 1,3 is on the left of 2 and so on. Starting from 1, each person kills the person on the left. Who will be the last person standing

Grade:10

1 Answers

ADITI SINGH
95 Points
7 years ago
Here, we can define an array with 100 elements with values from 1 to 100.We have taken array element as a person. 1st person kills the next. So, starting from 1, we'll remove next element i.e. 2. Then first person gives sword to next to next i.e. 3. That person will also kill next person and this continues. Means, in array, we need to start with 1 and remove the every other (alternate) element till 100. (all the even numbers will be removed and we'll be left with odd numbers only in array).After first iteration, we will have an array with 50 elements and we again need to remove every other (alternate) element. We need to repeat this process until we have only 1 element in the array and the last remaining element is the answer of who survives at last.

Think You Can Provide A Better Answer ?

ASK QUESTION

Get your questions answered by the expert for free