Nielsen Interview Question

Algorithm involving strings and how to work with it