Cure.Fit interview question

All increasing and decreasing triplets in an array.