Driver code
Activity = [ [ 5 , 9 ] , [ 1 , 2 ] , [ 3 , 4 ] , [ 0 , 6 ] , [ 5 , 7 ] , [ 8 , 9 ] ] ; n = Activity . length ; selected = MaxActivities ( Activity , n ) ; document . write ( " " ) console . log ( selected ) for ( let i = 0 ; i < selected . length ; i ++ ) document . write ( " " + selected [ i ] + " " )