Shopee Interview Question

Write efficient code to find 2nd largest element in array, by considering all possible user inputs.