Cure.Fit Interview Question

All increasing and decreasing triplets in an array.