← All problemsSign in

Drinking Game

Jon, Sam and David are playing a drinking game. They have $N$ potions where the value at $i$-th index denotes the strength of the $i$-th potion. Higher the strength, the more stronger one can get. They can choose **any** $3$ in random order out of which Jon will pick the potion with highest strength. Sam will pick the next potion with maximum strength and David will pick the last potion. Find t

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start