HSBC interview question

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