Meta Interview Question

Write a program to check whether the array is monotonic