Question icon
Grade 10Discuss with Askiitians Tutors

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

Profile image of Shatakshi Chaturvedi
9 Years agoGrade 10
Answers icon

1 Answer

Profile image of ADITI SINGH
9 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.