You are viewing a single comment's thread. Return to all comments →
int numRocks, allRocks = 0xfffffff; cin >> numRocks; while (numRocks--) { string s; cin >> s; int thisRock = 0; for (char ch : s) thisRock |= 1 << (ch - 'a'); allRocks &= thisRock; } cout << __builtin_popcount(allRocks) << endl; 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 →