Implement strStr (Find First Occurrence)
Easy
Strings
Print the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Constraints
1 <= len(haystack), len(needle) <= 10^4 Lowercase English letters
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.