Driver code
let matrix = [ [ 2 , 4 , 6 ] , [ 8 , 10 , 12 ] , [ 14 , 16 , 18 ] , [ 20 , 22 , 24 ] ] ; let n = matrix . length ; let m = matrix [ 0 ] . length ; let k = 2 ; document . write ( minOperations ( n , m , k , matrix ) ) ;