Solution to Find A Substring

The following is the solution to Hacker Rank problem "Find a Substring"
Algorithms > Regex > Find a Substring