Skip to content

Instantly share code, notes, and snippets.

@hoanbka
Created October 24, 2017 17:54
Show Gist options
  • Save hoanbka/d23f7411c766d28491b020764a84c5f4 to your computer and use it in GitHub Desktop.
Save hoanbka/d23f7411c766d28491b020764a84c5f4 to your computer and use it in GitHub Desktop.
def solve(str):
standardStr = 'hackerrank'
i = 0
count = 0
for j in str:
if j == standardStr[i]:
i += 1
count += 1
if count == len(standardStr):
break
if len(standardStr) == count:
return 'YES'
else:
return 'NO'
print(solve('hackerrank'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment