Tesla interview question

DP programming on string construction