/strstr

Primary LanguageC

strstr [needle in the haystack]

Write strstr in the library with the following constraint:

  • No extra variables [eg: int i]
  • Return the string back from where you found the needle. Example 1: Haystack: this is a test Needle:is Expected:is is a test

Example 2: Haystack: this is a test Needle:test Expected:test

Example 3: Haystack: this is a test Needle:a Expected:a test