#include<bits/stdc++.h> #include <iostream> #include <vector> #include <utility> #include <iterator> #include <algorithm> #include <deque> #include <cmath> #include <string> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); string X1 ,X2 ; getline(cin,X1) ; getline(cin,X2) ; vector<int>v1(52,0) ; vector<int>v2(52,0) ; for(auto i:X1){ if(i==' '){ continue ; } if(i>='a'){ v1[i-('A')-6]++ ; } else if(i<='Z') { v1[i-('A')]++ ; } } int flag=1 ; for(auto i:X2){ if(i==' '){ continue ; } if(i>='a'){ if(v1[i-'A'-6]==0){ flag=0 ; break ; } } else if(i<='Z') { if(v1[i-('A')]==0){ flag=0 ; break ; } } } if(flag==1){ cout<<"YES"<<endl; } else { cout<<"NO"<<endl; } return 0; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter