Driver code
let arr = [ [ 0 , 0 , 0 , 0 ] , [ 0 , 1 , 1 , 0 ] , [ 0 , 0 , 1 , 0 ] , [ 0 , 1 , 0 , 1 ] ] ; let range1a = 2 , range1b = 2 ; let range0a = 2 , range0b = 3 ; let K = 3 ; let b = new Array ( N ) ; for ( let i = 0 ; i < N ; i ++ ) { b [ i ] = new Array ( N ) ; for ( let j = 0 ; j < N ; j ++ ) { b [ i ] [ j ] = 0 ; } }