-
-
Save ldco2016/62d5b8e4174c3bb3599c58dd0052d337 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