Driver code
public static void main ( String [ ] args ) { int arr1 [ ] = { 10 , 5 , 2 , 7 , 10 } ; int n1 = arr1 . length ; System . out . println ( minTime ( arr1 , n1 ) ) ; int arr2 [ ] = { 10 , 5 , 7 , 10 } ; int n2 = arr2 . length ; System . out . println ( minTime ( arr2 , n2 ) ) ; int arr3 [ ] = { 10 , 5 , 2 , 4 , 8 , 6 , 7 , 10 } ; int n3 = arr3 . length ; System . out . println ( minTime ( arr3 , n3 ) ) ; } }