Marshall Wace interview question

Some string based leetcode questions.