Pregunta de entrevista de Cure.Fit

All increasing and decreasing triplets in an array.