@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
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
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;
}
}