FunctionRacerProblemsRace

Second Highest Salary

EasypandasPython

staff has columns name and salary. Return the second highest different salary as an int. For example with salaries 100, 100, 80 the answer is 80. If there is no second different salary, return -1.

Example 1

staff {"name":["a","b","c"],"salary":[100,100,80]}
returns 80

The salaries are 100 and 80, so the answer is 80.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More pandas problems