Constraint for two dimensional array

In reply to Subbi Reddy:

The question was to generate increasing and decreasing values as per given conditions.

It was only an eg that you gave. Is it necessary to generate the largest value in every row even if the condition holds?