Get Minimum Moves Leetcode Javascript Solutions