Created
February 11, 2017 15:55
-
-
Save idimitrov07/bb26bf8bfe385963fabbb12af04607f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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