Google Cloud Interview Question

Frog leap problem similar to leetcode