Given matrix arr [ ] [ ]
let arr = [ [ 0 , 1 , 1 , 1 , 0 ] , [ 1 , 0 , 1 , 0 , 1 ] , [ 1 , 1 , 1 , 0 , 0 ] ] ; let p = endpoints ( arr , M , N ) ; document . write ( " " + p [ 0 ] + " " + p [ 1 ] + " " + " " ) ;