Wells Fargo interview question

String chain problem that requires recursion or DP.