The idea here is that all the even occurrence if any given char cancel each other and we can have at most one char occurring odd number of times in palindrome.

```
bool canPermutePalindrome(string s) {
vector<bool> h(256, false);
for (auto x : s)
h[x] = !h[x];
int cnt=0;
for (auto x : h)
if (x) cnt++;
return cnt < 2;
}
```