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 targetStr = "hackerrank"; for(int a0 = 0; a0 < q; a0++){ string res = "NO"; string s = Console.ReadLine(); int tarInd = 0; for (int sInd = 0; sInd < s.Length; sInd++) { if (String.Equals(s.Substring(sInd, 1), targetStr.Substring(tarInd, 1))) { tarInd++; } if (tarInd == targetStr.Length) { res = "YES"; break; } } Console.WriteLine(res); } } }