using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static string isSubSequence(string str) { string hackStr = "hackerrank"; int m = hackStr.Length; int j = 0; for (int i = 0; i < str.Length && j < m; i++) if (hackStr[j] == str[i]) j++; string result = "NO"; if (j == m) { result = "YES"; } return result; } static void Main(string[] args) { int q = Convert.ToInt32(Console.ReadLine()); List results = new List(); for (int a0 = 0; a0 < q; a0++) { string s = Console.ReadLine().ToLower(); results.Add(isSubSequence(s)); } for (int i = 0; i < results.Count; i++) { Console.WriteLine(results[i]); } Console.ReadLine(); } }