Adobe Interview Question

Algorithm - find minimum and maximum of the array after each query.