Loop to evaluate each column of the prefix matrix uniquely . For each index of a column we will try to determine the number of sub - matrices starting from that index and has all 1 s
for ( int j = 0 ; j < n ; j ++ ) { int i = n - 1 ;