Constraint for two dimensional array

In reply to Subbi Reddy:

And for the diagonal to initiate from the left, you can use a for loop instead of a foreach loop