Finds the maximal increasing sequence in an array.