I got the point that i need to get the set of char that appear only one time in one string of given set of string ,here is my code what could i possible be missing that i am not able to solve it.
#define ll long long
#define f(end) for(int i=0;i<end;i++)
#define e '\n'
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t=1,n;
// cin>>t;
while(t--)
{
cin>>n;
int temp=0;
string s,demo;
map<char,int> mp;
f(n){
cin>>s;
for(int j=0;j<s.length();j++){
if(mp[s[j]]<=temp) mp[s[j]]++;
}
temp++;
}
string ans="";
for(auto it:mp){
if(it.second==n) ans+=it.first;
}
if(ans=="") cout<<"no such string"<<e;
else cout<<ans<<e;
}
return 0;
}