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 find = "hackerrank"; for(int a0 = 0; a0 < q; a0++){ string s = Console.ReadLine(); // your code goes here int pos = 0; foreach(char c in s) { if(find[pos] == c) { pos++; if(pos == find.Length) break; } } Console.WriteLine(pos==find.Length ? "YES" : "NO"); } } }