It will take O(1) time.
since it is given that all are distinct element so, lets say array of 5 element
A = {4, 7, 3, 8, 10} is given,
now when you compare first 3 number 4, 7, 3 you can say that 3 is minimum and 7 is maximum where
4 is neither minimum nor maximum, Hence using only 3 comparison means in O(1) time you can find it.
Hence, it is O(1).