Compute max coins with 3-step token moves | Google Interview Question