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()); for(int a0 = 0; a0 < q; a0++){ string s = Console.ReadLine(); const string hackerrank = "hackerrank"; int hrIndex = 0; bool found = false; for(int i = 0; i < s.Length; ++i) { if(hackerrank[hrIndex] == s[i]) { ++hrIndex; if(hrIndex == hackerrank.Length) { found = true; break; } } } Console.WriteLine($"{found ? "YES" : "NO"}"); } } }