Get Minimum Moves Leetcode Javascript Problems