SquareBoat Interview Question

finding the max and second max element in an array