0
/ 10
Recursive procedure that returns the number of H in a string of heads (H) or tails (T) outcomes. This must be a recursive routine. You...
Recursive procedure that returns the number of
H in a string of heads (H) or tails (T) outcomes.
This must be a recursive routine. You can assume
that the argument str
has only H and T in uppercase.
Examples:
countFlipCoin("HT") -> 1
countFlipCoin("HTH") -> 2
countFlipCoin("THTH") -> 2
Your feedback will appear here when you check your answer.