stupid c++ solution


  • 0
    bool canPermutePalindrome(string s) {
            int count[256] = {0}, odd = 0;;
            for (auto c : s)
                ++count[c] & 1 == 1 ? ++odd : --odd;
            return odd <= 1;
    }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.