Qm

In a random row, how many are taller than their neighbors?

Ten people, all of different heights, stand in a single row in a completely random order. Call a person a "peak" if they are taller than every person standing directly next to them. The two people at the ends of the row each have just one neighbor.

On average, how many peaks are there in the row of 10?

Your answer

Solving needs a free account

Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.

Discussion

Sign in to join the discussion Β· reading is open to everyone

πŸ’‘ Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

Around a round table, how many beat both neighbors?In a random row, how many dip below both neighbors?Around a ring of nine, how many top both neighbors?Interior peaks in a random sequence of readingsHow many rising steps in a shuffled list?
All questions β†’