Modify a binary array to Bitwise AND of all elements as 1 | Function to check if it is possible or not ; Driver code
function check ( a , n ) { for ( var i = 0 ; i < n ; i ++ ) if ( a [ i ] ) return true ; return false ; } var a = [ 0 , 1 , 0 , 1 ] ; var n = a . length ; check ( a , n ) ? document . write ( " " ) : document . write ( " " ) ;