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 hackerrank=CountChars("hackerrank"); Dictionary 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 CountChars(String str){ char[] arr=str.ToCharArray(); Dictionary result=new Dictionary(); foreach(char ch in arr){ if(result.ContainsKey(ch)){ result[ch]+=1; }else{ result.Add(ch,1); } } return result; } }