Ad
  • Custom User Avatar

    Because sorting the array once is slower than iterating through it twice.

  • Default User Avatar

    Why not sort the array once and then take the last and first elements?

  • Custom User Avatar

    That's certainly an interesting existential quandary.

    So in what kind of universe can you occupy a place among "p" number of people where you can have more than "p" number of people standing before you?

    If such universe indeed exists, "should" we denote such circumstance as having zero number of people before you? I mean, should it even matter what we call anything at that point?

    But you are right.

    Use of uint might have been more appropriate.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution