Leetcode – strStr()

Name: strStr()Difficulty: EasyDescription: Find the needle in the haystack, return the first index of or -1 if not found. Example: Input: haystack = “hello”, needle = “ll” Output: 2 Interestingly, I used simple indexing in this solution rather than iterators. I suspect, whilst very fast, the iterators were the cause of the higher memory consumption […]