EMITL - Editorial

@idk_anything
As mentioned in the above editorial, the smallest such string possible is LTIMEMITL. The output for this should be YES while your code outputs NO. Hence the WA :slight_smile:

I am sorry but did you check the old link this one outputs NO for LTIMETIME

already got it bro .!!..but thanks for your time and further clarification :smiley:

what’s wrong in my code
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define lli long long int
#include
using namespace std;
bool present(string s)
{
unordered_map <char,lli>arr;
for(lli i=0;i<s.length();i++)
arr[s[i]]+=1;
for(auto x:arr)
{
if(x.first==β€˜L’ || x.first==β€˜T’ || x.first==β€˜I’ || x.first==β€˜M’ || x.first==β€˜E’){
if(x.second<2)
return false;
}
}
return true;
}
int main()
{
lli t,x;
cin>>t;
while(t–)
{
string s;
cin>>s;
if(present(s))
cout<<β€œYES”<<endl;
else
cout<<β€œNO”<<endl;
}
}