Question d’entretien chez Meta

Write a program to check whether the array is monotonic