Next Greater Integer Leetcode Problems Javascript