Previous Greater Element Leetcode Javascript 30