```
class Solution {
public:
int firstUniqChar(string s) {
int64_t db = 0;
for(auto c:s)
{
int64_t i = db&(int64_t(3) << ((c-'a')<<1));
if(i==0)
db|=(int64_t(1) << ((c-'a')<<1));
else
db|=(int64_t(2) << ((c-'a')<<1));
}
int i = 0;
for(auto c:s) {
if((int64_t(db >> ((c-'a')<<1))&0b11)== 1)return i;
++i;
}
return -1;
}
};
```