Function to return the maximum marks by considering topics which can be completed in the given time duration
function MaximumMarks ( marksarr , timearr , h , n , p ) { let no_of_topics = n + 1 ; let total_time = h + 1 ; let T = new Array ( no_of_topics ) ; for ( let i = 0 ; i < no_of_topics ; i ++ ) { T [ i ] = new Array ( total_time ) ; for ( let j = 0 ; j < total_time ; j ++ ) { T [ i ] [ j ] = 0 ; } }