Suppose i have given n basically n*n matrix with all zero's at start.
And sum's associated with each row and column is given.
eg. n=4
Matrix:
0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0
given rows sum : 2, 2, 1, 1
given columns sum: 2, 0, 2, 2
So output matrix should look like:
0 0 1 1
1 0 0 1
0 0 1 0
1 0 0 0
There's always a solution exist.
So for n=4, 0<=rowsum<=4 and 0<=columnsum<=4