# -*- coding: utf-8 -*-
# @Time    : 2021-07-14 09:02
# @Author  : zxl
# @FileName: SHIEN02.py


class Solution:
    def strStr(self , haystack , needle ):

        if needle == '':
            return 0

        n = len(needle)
        count = 0
        for i in range(len(haystack)):
            if haystack[i:i+n] == needle:
                return i
        return -1



obj = Solution()
haystack = 'shein'
needle = 'in'
ans = obj.strStr(haystack,needle)
print(ans)
b304a50d3561408b7b4a18d6ecc4658052ae814b
class Solution:
    <mask token>


<mask token>

class Solution:

    def strStr(self, haystack, needle):
        if needle == '':
            return 0
        n = len(needle)
        count = 0
        for i in range(len(haystack)):
            if haystack[i:i + n] == needle:
                return i
        return -1


<mask token>

class Solution:

    def strStr(self, haystack, needle):
        if needle == '':
            return 0
        n = len(needle)
        count = 0
        for i in range(len(haystack)):
            if haystack[i:i + n] == needle:
                return i
        return -1


<mask token>
print(ans)

class Solution:

    def strStr(self, haystack, needle):
        if needle == '':
            return 0
        n = len(needle)
        count = 0
        for i in range(len(haystack)):
            if haystack[i:i + n] == needle:
                return i
        return -1


obj = Solution()
haystack = 'shein'
needle = 'in'
ans = obj.strStr(haystack, needle)
print(ans)

# -*- coding: utf-8 -*-
# @Time    : 2021-07-14 09:02
# @Author  : zxl
# @FileName: SHIEN02.py


class Solution:
    def strStr(self , haystack , needle ):

        if needle == '':
            return 0

        n = len(needle)
        count = 0
        for i in range(len(haystack)):
            if haystack[i:i+n] == needle:
                return i
        return -1



obj = Solution()
haystack = 'shein'
needle = 'in'
ans = obj.strStr(haystack,needle)
print(ans)