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 searchWord = "hackerrank"; char[] search = searchWord.ToCharArray(0, searchWord.Length); for(int a0 = 0; a0 < q; a0++){ string s = Console.ReadLine(); // your code goes here char[] input = s.ToCharArray(0, s.Length); int searchIdx = 0; int inputIdx = 0; for(int i = 0; i < s.Length && searchIdx < searchWord.Length; ++i) { if(input[i] == search[searchIdx]) { searchIdx++; } } if(searchIdx == searchWord.Length){ Console.WriteLine("YES"); } else { Console.WriteLine("NO"); } } } }