We are given a matrix M of dimension N*N. All the cells are initially, zero. Also we are given Q queries, which contains 4 integers a b c d. where (a,b) is the TOP LEFT cell and (c,d) is the Bottom Right cell of a submatrix. Now, all the cells of This submatrix has to be incremented by one. After all the Q queries have been performed. Your task is to print the final resulting Matrix.
I know the 1-D version of this problem. But I'm having difficulties implementing it in 2-D form. Any inputs regarding the same?