Burglary Series (05): Third Most Expensive

Published by werdna in

Time to call your lover to inform him/her what he/she lost in the burglary.

Given a dictionary of the stolen objects, return the 3rd most expensive item on the list. If that is not possible, because there are not enough items, return False.

Examples

third_most_expensive({}) ➞ False
# Items are less than three.

third_most_expensive({"piano": 100, "stereo": 200 }) ➞ False
# Items are less than three.

third_most_expensive({"piano": 100, "stereo": 200, "tv": 10, "timmy": 500 }) ➞  "piano"
# 'piano' is the third most expensive item.

Notes

All prices will be of different monetary values.

Watch a quick demo on how Edabit works.