Driver code
public static void main ( String [ ] args ) { int arr [ ] = { 4 , 2 , - 3 , 3 , - 2 , - 2 , 8 } ; int n = arr . length ; System . out . print ( " Maximum ▁ Difference ▁ = ▁ " + maxDiff ( arr , n ) ) ; } }