Flag Discuss with Askiitians Tutors> There are 1000 people standing in a circl...
question mark

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

Shatakshi Chaturvedi , 8 Years ago
Grade 10
anser 1 Answers
ADITI SINGH

Last Activity: 8 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.

Provide a better Answer & Earn Cool Goodies

star
LIVE ONLINE CLASSES

Prepraring for the competition made easy just by live online class.

tv

Full Live Access

material

Study Material

removal

Live Doubts Solving

assignment

Daily Class Assignments


Ask a Doubt

Get your questions answered by the expert for free