there rectangular brick wall n row brick the ith row number brick height ie unit different width the total width row samedraw vertical line cross brick if line go edge brick brick consider cross you draw line vertical edge wall case line obviously cross bricksGiven 2D array wall contain information wall return minimum number cross brick draw vertical line Example 1input wall 1221312132243121311output 2example 2input wall 111output 3 Constraintsn walllength1 n 1041 wallilength 1041 sumwallilength 2 104sumwalli row i1 wallij 231 1