Function to find the minimum cost
function find_min_odd_cost ( given , m , n ) { let floor = new Array ( M ) ; for ( let i = 0 ; i < M ; i ++ ) { floor [ i ] = new Array ( N ) ; for ( let j = 0 ; j < N ; j ++ ) { floor [ i ] [ j ] = 0 ; } } let min_odd_cost = 0 ; let i , j , temp ; for ( j = 0 ; j < n ; j ++ ) floor [ 0 ] [ j ] = given [ 0 ] [ j ] ; for ( i = 1 ; i < m ; i ++ ) for ( j = 0 ; j < n ; j ++ ) {