Driver Code
int main ( ) { int k = 3 ; int price [ ] = { 12 , 14 , 17 , 10 , 14 , 13 , 12 , 15 } ; int n = sizeof ( price ) / sizeof ( price [ 0 ] ) ; cout << " Maximum ▁ profit ▁ is : ▁ " << maxProfit ( price , n , k ) ; return 0 ; }