Skip to content

Latest commit

 

History

History
22 lines (12 loc) · 276 Bytes

File metadata and controls

22 lines (12 loc) · 276 Bytes

Problem 28: Implement strStr()

Difficulty: Easy

Problem

Implement strStr().

Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

Example

haystack = "string"
needle = "ring"

returns 2