Google interview question

Pretty straightforward question to do with finding substrings in strings