Lendlord Interview Question

Some string manipulation question. Nothing too complicated.