Find a Substring
easyGiven two strings s and q, return the index of q in s if q is a substring of s, otherwise return −1.
Input: s = "abcdefg", q = "cdef"
Output: 2Find a Substring
Given two strings s and q, return the index of q in s if q is a substring of s, otherwise return −1.
Input: s = "abcdefg", q = "cdef"
Output: 2