Pergunta de entrevista da empresa Ottopia Technologies

Return true in case a given array is non-decreasing or non-increasing, otherwise false.