JPMorganChase interview question

dsa questions were on strings