Skip to content

Instantly share code, notes, and snippets.

@idimitrov07
Created February 11, 2017 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save idimitrov07/bb26bf8bfe385963fabbb12af04607f2 to your computer and use it in GitHub Desktop.
Save idimitrov07/bb26bf8bfe385963fabbb12af04607f2 to your computer and use it in GitHub Desktop.
q = gets.strip.to_i
for a0 in (0..q-1)
s = gets.strip
# your code goes here
# hackerrank
word = ""
index = 0
s.each_char do |c|
if c == "hackerrank"[index]
word += c
index += 1
end
end
puts word == "hackerrank" ? "YES" : "NO"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment