Meta Interview Question

monotonic array leet code question,