Google Interview Question

Pretty straightforward question to do with finding substrings in strings