Find the first occurrence of a word in a sentence, e.g. sentence 'can a cat eat grass cat?', pet 'cat' returns 6.
Asked in the round 3 stage. Implement the function using zero-based character indexing. Treat pet as a case-sensitive contiguous substring, including occurrences inside longer words.
find_first_occurrence(sentence, pet) receives two strings and returns the starting index of the first occurrence, or -1 if pet does not occur. If pet is empty, return 0.
def find_first_occurrence(sentence, pet):