HSBC Interview Question

2 sum problem from leetcode How to find the second highest salary