Constraint for two dimensional array

In reply to Juhi_Patel:

  1. In array rows and columns should equal

  2. diagonal value should be same like i=0 j=max_col-1; arr[i]([j=max_col-1-i]== arr[i+1][j-max_col-1-i]) for understanding purpose look at matrix example or you can search in google for diagnoal matrix.

  3. In each row before(left side) diagonal value(column) value should be increment like arr[i][j-1] <arr[i][j].

    1. In each row after(right side) diagonal value(column) value should be decrement like arr[i][j-1] > arr[i][j]

This is an interview Question, interviewer not explained properly to me, its took time to understand question properly.

1 Like