← All problemsSign in

Heads and Tails

Problem Statement Jalote just received a simple unbiaased coin from his mother and began tossing it. After playing with coin for some time, the little mathematician in him started noticing the number of times he had to toss the coin in order to see both the faces of the coin. After repeating the experiment many times, he inferred that the expected number of tosses he had to do were 3. This made

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