Third Maximum Element Leetcode Javascript