text: matrix to store the status of ith bit of each element of matrix arr
code: bool [ , ] set_bit = new bool [ n , n ] ; for ( int R = 0 ; R < n ; R ++ ) for ( int C = 0 ; C < n ; C ++ ) set_bit [ R , C ] = ( ( arr [ R , C ] & ( 1 << i ) ) != 0 ) ; sum += ( mul * matrixAllOne ( set_bit ) ) ; mul *= 2 ; } return sum ; }