Nth Highest Salary
staff has columns name and salary. Return the n-th highest different salary as an int (n = 1 is the highest). If there are fewer than n different salaries, return -1.
Example 1
staff {"name":["a","b","c","d"],"salary":[50,70,70,20]}
n 2
returns 50
Different salaries: 70, 50, 20. The 2nd is 50.
Constraints
n >= 1
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.