Alice and the Array
Alice is playing a game with permutations of size $N$. - She selects a random *permutation* $P$ of size $N$ and a random index $i$ $(1\le i \le N)$; - She keeps incrementing the index $i$ **until**: - The next element is greater than the current element $(P_{(i+1)} > P_i)$, or; - She reaches the last index $(i = N)$. Find the [expected](https://en.wikipedia.org/wiki/Expected_value) nu
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start