Driver code
public static void main ( String [ ] args ) { int arr [ ] = { 10 , 100 , 300 , 200 , 1000 , 20 , 30 } ; int n = arr . length ; int k = 3 ; System . out . println ( minDiff ( arr , n , k ) ) ; } }