My issue
My code
#include <iostream>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
// your code goes here
ll int t;
std::cin >> t;
while(t--)
{
ll int n;
cin>>n;
string a;
cin>>a;
for(ll int i=1;i<n;i++)
{
string s; string str;
cin>>s;
for(ll int p=0;p<a.size();p++)
{
for(ll int q=0;q<s.size();q++)
{
if(a[p]==s[q])
{
str+=s[q];
s.erase(s.begin()+q, s.begin()+q+1);
break;
}
}
}
a=str;
}
std::cout << a.size() << std::endl;
}
return 0;
}
Problem Link: CHEFING Problem - CodeChef