Quote Originally Posted by Salem View Post
> what about this input?
Have you specified what should happen when 1 and 0 are opposite one another?
mmm specified in my third example in my description, but doesn't matter I will explain it, when 1 and 0 are opposite one another then if there's a free space for one that's opposite to 0 I will assign it over the free space while in the same time ensuring matrix stabilized.

for example:
1 1 1
- - -
- - 0
output:
printf("there's no possibility for stabilizing this matrix")
because
1 1 0
1 1 1
1 1 0
will never be stabilized but if I have matrix 4*4 for example
1 1 1 1
- - - -
- - - -
- - 0 0
the output: here we have much free spaces which can ensure stabilization of the matrix
1 1 1 1
- - 1 1
1 1 1 1
1 1 0 0
this is the maximum matrix that I can fill with 1 to be stabilized .. "we need always maximum number of ones to fill for stabilizing the matrix"


So? thanks alot