🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Ranking and Order: all 7 questions

Quiz: Ranking and Order · Question 7 of 7

Why is 1 subtracted in "Total = from left + from right − 1"?

Why is 1 subtracted in "Total = from left + from right − 1"?

  1. A.Because rows start from 0
  2. B.Because one seat is always empty
  3. C.Because the person is counted from both ends
  4. D.Because the last person is not counted
Answer & explanation

Correct answer: Because the person is counted from both ends

The person's own place is included in both counts, so it is counted twice.

Can you get the rest right without peeking?

Take the timed Quiz: Ranking and Order quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →