Leetcode Next Greater Integer Function