using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { int q = Convert.ToInt32(Console.ReadLine()); var hr = "hackerrank"; int count, length; bool found; for(int a0 = 0; a0 < q; a0++){ string s = Console.ReadLine(); count = 0; found = false; length = s.Length; for(int i = 0; i < length; i++) { if(hr[count] == s[i]) { count++; if(count == 10) { found = true; break; } } } Console.WriteLine(found ? "YES" : "NO"); } } }