Recursive Array Sorted Check with Max Constraint