Infosys interview question

Write code to find the second maximum element from the array?