Bank of America Interview Question

Recursive coin task