HackerRank in a String!

  • + 0 comments
    def hackerrankInString(s):
        h='hackerrank1'
        j=0
        for i in s:
            if i==h[j]:
                j+=1
        if j==10:
            return 'YES'
        return 'NO'