LeetCode should optimize it's solution. I saw the below today for Second Highest Salary. My solution was correct but the Expected (which was solved by LeetCode) is TLE