al-go-rithms icon indicating copy to clipboard operation
al-go-rithms copied to clipboard

Find the index of the first occurrence in a string. (String Problem)

Open kanikarajpal opened this issue 1 year ago • 3 comments

This is a(n):

  • [x] New algorithm
  • [ ] Update to an existing algorithm
  • [ ] Error
  • [ ] Proposal to the Repository

Details: I would like to add a solution to a problem- Find the index of the first occurrence in a string. (Leetcode Problem) (Python).

Description - Given two strings needle and haystack, return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.

Link - https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/

kanikarajpal avatar Oct 12 '22 10:10 kanikarajpal