HackerRank in a String!

  • + 1 comment

    def hackerrankInString(s): # Write your code here

    fs = 'hackerrank'
    if len(s) < len(fs):
            return 'NO'
    for i in range(len(fs)):
            for c in s:
                    if c == fs[i]:
                            i +=1
                    if i == len(fs):
                            return 'YES'
            return 'NO'