Driver code
public static void main ( String [ ] args ) { int k = 3 ; int price [ ] = { 12 , 14 , 17 , 10 , 14 , 13 , 12 , 15 } ; int n = price . length ; System . out . println ( " Maximum ▁ profit ▁ is : ▁ " + maxProfit ( price , n , k ) ) ; } }