scramble string dp