Snap Interview Question

- reverse an array - sort array if monotonic subsequence detected