You are viewing a single comment's thread. Return to all comments →
what am i doing wrong????
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; vector <vector<int>> a(n,vector<int> (26)); int j=0; while(j<n){ string s; cin>>s; for(int i=0;i<s.size();i++){ a[j][s[i]-'a']=1; } j++; } int result =0; for(int i=0;i<26;i++){ int c=0; for(int k=0;i<n;k++){ if(a[k][i]==1){ c++; } } if(c==n){ result++; } } cout<<result; return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Gemstones
You are viewing a single comment's thread. Return to all comments →
what am i doing wrong????