Frog Jump Problem Leetcode Python