Driver code
public static void main ( String [ ] args ) { int k = 3 ; int prices [ ] = { 1 , 12 , 10 , 7 , 10 , 13 , 11 , 10 , 7 , 6 , 9 } ; int n = prices . length ; System . out . println ( " Maximum ▁ profit ▁ is ▁ " + maxProfit ( n , k , prices ) ) ; } }