Scramble String DP solution