Driver code to test above
public static void Main ( ) { int k = 3 ; int [ ] price = { 12 , 14 , 17 , 10 , 14 , 13 , 12 , 15 } ; int n = price . Length ; Console . Write ( " Maximum ▁ profit ▁ is : ▁ " + maxProfit ( price , n , k ) ) ; } }