Morgan Stanley Interview Question

Coding problem about largest string.