题解 | #彩色的砖块#
彩色的砖块
https://www.nowcoder.com/practice/8c29f4d1bea84d6ba2847e079b7420f7
#include <bits/stdc++.h> #include <unordered_map> using namespace std; int main() { string s; cin >> s; unordered_map<char,int> map; for(int i = 0; i < s.size(); i++){ map[s[i]]++; } if(map.size() > 2){ cout << 0; }else{ cout << map.size(); } } // 64 位输出请用 printf("%lld")