Meta interview question

monotonic array leet code question,