You are given two strings — text and pattern.
Your task is to find the index of the first occurrence of pattern inside text.
If the pattern is not found in text, return -1.
The search should be case-sensitive and based on the exact match of characters.
Input: text = "learningpython" pattern = "python"
Output: 8
Input: text = "developer" pattern = "code"
Output: -1
Accepted:
Submission: