GlobalLogic interview question

Python coding: second maximum number etc.