Driver code
int main ( ) { int arr [ ] = { 10 , 15 , 20 , 9 , 2 , 5 } , k = 2 ; int n = sizeof ( arr ) / sizeof ( int ) ; memset ( dp , 0 , sizeof ( dp ) ) ; cout << solve ( arr , 0 , n - 1 , k ) ; return 0 ; }