Morgan Stanley interview question

Coding problem about largest string.