text: Checking every column for duplicate characters
code: for ( k = 0 ; k < m ; k ++ ) { if ( a [ i ] . charAt ( j ) == a [ i ] . charAt ( k ) && j != k ) { isPresent [ i ] [ j ] = true ; isPresent [ i ] [ k ] = true ; } } } } for ( var i = 0 ; i < n ; i ++ ) for ( var j = 0 ; j < m ; j ++ )