Just for fun :)


  • 0
    Y
    int strStr(string haystack, string needle) {
            int i = haystack.find(needle);
            if (i <= haystack.size())
                return i;
            else
                return -1;
        }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.