Coding challenge for finding the substring of a string