面试题 01.01
Solutions
class Solution {
public:
bool isUnique(string astr) {
int seen = 0;
for (auto c : astr)
if (seen & (1 << (c - 'a')))
return false;
else
seen |= (1 << (c - 'a'));
return true;
}
};Last updated