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()); string h = "hackerrank"; for(int a0 = 0; a0 < q; a0++){ int i = 0; bool flag = false; string s = Console.ReadLine(); // your code goes here for(int j = 0; j < s.Length; j++){ if(s[j] == h[i]){ if(i < 9) i++; else{ flag = true; break; } } } if(flag) Console.WriteLine("YES"); else Console.WriteLine("NO"); } } }