Get Minimum Moves Leetcode Playground Java