Write a string to find a substring in a given string. Do this in O(n) or better Ruby Algorithm Performance Easy Amazon Facebook