Driver program to test above functions
public static void main ( String [ ] args ) { int arr [ ] = { - 10 , - 3 , 5 , 6 , - 20 } ; int n = arr . length ; int max = maxProduct ( arr , n ) ; if ( max == - 1 ) { System . out . println ( " No ▁ Triplet ▁ Exists " ) ; } else { System . out . println ( " Maximum ▁ product ▁ is ▁ " + max ) ; } } }