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(); // your code goes here Dictionary<char,int> hackerrank=CountChars("hackerrank"); Dictionary<char,int> input=CountChars(s); string flag="YES"; foreach(char key in hackerrank.Keys){ if(input.ContainsKey(key)){ if(input[key] < hackerrank[key]){ flag="NO"; break; } }else{ flag="NO"; break; } } Console.WriteLine(flag); } } static Dictionary<char,int> CountChars(String str){ char[] arr=str.ToCharArray(); Dictionary<char,int> result=new Dictionary<char,int>(); foreach(char ch in arr){ if(result.ContainsKey(ch)){ result[ch]+=1; }else{ result.Add(ch,1); } } return result; } }