dp [ i ] [ j ] = minimum val of accommodation till j 'th index of the string  using i+1 number of buckets.  Final ans will be in dp[n-1][K-1]  Initialise dp with all states as 0
dp = [ [ 0 for i in range ( n ) ] for j in range ( K ) ] NEW_LINE