Next Greater Integer Leetcode Solutions Java