Get Minimum Moves Leetcode Python Coding