Appinventiv interview question

Program to find second largest and second minimum in an array