Third Maximum Element Leetcode Problems Javascript