Function to initialize the dp and call solveUtil ( ) method to get the answer
def solve ( str1 , K ) : NEW_LINE INDENT N = len ( str1 ) NEW_LINE dp = [ [ - 1 for i in range ( K ) ] for i in range ( N ) ] NEW_LINE DEDENT