Driver Code
let arr1 = [ 10 , 5 , 2 , 7 , 10 ] ; let n1 = arr1 . length ; document . write ( minTime ( arr1 , n1 ) + " " ) ; let arr2 = [ 10 , 5 , 7 , 10 ] ; let n2 = arr2 . length ; document . write ( minTime ( arr2 , n2 ) + " " ) ; let arr3 = [ 10 , 5 , 2 , 4 , 8 , 6 , 7 , 10 ] ; let n3 = arr3 . length ; document . write ( minTime ( arr3 , n3 ) + " " ) ;