Driver code
int main ( ) { int k = 3 ; int prices [ ] = { 1 , 12 , 10 , 7 , 10 , 13 , 11 , 10 , 7 , 6 , 9 } ; int n = sizeof ( prices ) / sizeof ( prices [ 0 ] ) ; cout << " Maximum ▁ profit ▁ is ▁ " << maxProfit ( n , k , prices ) ; return 0 ; }