Find a Substring

easy

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