Driver Code
let A = [ [ 1 , 1 , 0 ] , [ 0 , 0 , 1 ] , [ 0 , 1 , 0 ] ] ; let B = [ [ 0 , 0 , 1 ] , [ 0 , 1 , 0 ] , [ 1 , 1 , 0 ] ] ; let N = A . length ; let M = B [ 0 ] . length ; document . write ( minSwaps ( N , M , A , B ) ) ;