Leetcode Next Greater Element Geeksforgeeks Javascript