For those of you who suggested that swapping key value pairs is a better option. I am afraid to say that you still have to iterate through the dictionnary twice. The process should be something like this:

1 st iteration: convert salaries to numerical values.

2nd iteration : swapping

Finally, access the max value of the swapped dictionnary

I hope this could help.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store