[Java] O(n) Time and O(1) Space Beats 100%
We can just simply use a 26 bit integer to store the set bits and then use XOR to flip the bits. \n\nclass Solution {\n    public boolean canConstruct(String s,
We can just simply use a 26 bit integer to store the set bits and then use XOR to flip the bits. \n```\nclass Solution {\n    public boolean canConstruct(String s, int k) {\n        int odd = 0;\n        \n        for (int i = 0; i < s.length(); i++) {\n            odd ^= 1 << (s.charAt(i) - \'a\');\n        }\n        \n        return Integer.bitCount(odd) <= k && k <= s.length(); \n    }\n}\n```
[]