Pergunta de entrevista da empresa Cure.Fit

All increasing and decreasing triplets in an array.