Function that returns true if it is possible to transport all the boxes in the given amount of time
function isPossible ( box , truck , n , m , min_time ) { let temp = 0 ; let count = 0 ; while ( count < m ) { for ( let j = 0 ; j < min_time && temp < n && truck [ count ] >= box [ temp ] ; j += 2 ) temp ++ ; count ++ ; }