If there is no change in boundaries than check if mat [ 0 ] [ 0 ] equals ' k ' If it is not equal to ' k ' then print that no such k - sum sub - matrix exists
if ( fup == 0 && fdown == 0 && fleft == 0 && fright == 0 && mat [ 0 ] [ 0 ] != k ) { cout << " No ▁ sub - matrix ▁ with ▁ sum ▁ " << k << " ▁ exists " ; return ; }