Source Code
#include<bits/stdc++.h>
#define ll long long
#define tt "\n"
#define loop(i,n) for(int i = 0 ; i < n; i++)
#define pb push_back
#define in insert
#define ff first
#define ss second
#define FMP make_pair
#define all(v) v.begin(),v.end()
const ll MOD = 1000000000+7;
#define YN(a) a?cout << "YES\n":cout << "NO\n";
using namespace std;
void input()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
ll fastPowerMod(ll x, ll y, ll mod)
{
    if(y == 0)
        return 1 % mod;
    ll u = fastPowerMod(x, y / 2 ,mod);
    u = u * u % mod;
    if(y & 1)
        u = u * x % mod;
    return u;
}
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int main()
{
    ios_base::sync_with_stdio(NULL);
    cin.tie(NULL);
    cout.tie(NULL);
    input();
    string s = "atypical";
    string d;
    cin >> d;
    map<char , ll > mp;
    for(int i =0 ; i < d.size(); i++){
        d[i] = tolower(d[i]);
        mp[d[i]]++;
    }
    ll ans = 1;
    for(int i = 0 ; i < s.size(); i++){
        if(mp[s[i]] < 0){
            ans = 0;
            break;
        }
        else
            mp[s[i]]--;
    }
}



Copy
We Love Atypical HashemGhanim
GNU G++17
2 ms
388 KB
Wrong Answer