Minimum value among AND of elements of every subset of an array | Javascript implementation of the approach ; Find AND of whole array ; Prlet the answer ; Driver code
function minAND ( arr , n ) { let s = arr [ 0 ] ; for ( let i = 1 ; i < n ; i ++ ) { s = s & arr [ i ] ; } document . write ( ( s ) + " " ) ; } let arr = [ 1 , 2 , 3 ] ; let n = arr . length ; minAND ( arr , n ) ;