Driver Code
public static void main ( String [ ] args ) { int arr [ ] = { 12 , 3 , 5 , 6 , 7 , 17 } ; int K = 2 ; int N = arr . length ; for ( int [ ] [ ] row : dp ) { for ( int [ ] innerrow : row ) { Arrays . fill ( innerrow , - 1 ) ; } } System . out . println ( minSumDifference ( arr , N - 1 , K , K , 0 , 0 ) ) ; } }