Help me to find the error, plz...
Guys, I\'m tired struggling with this problem. For me my logic is clear enough, but eventually I can\'t submit. Always some of tests fail...\n\nclass Solution {
Guys, I\'m tired struggling with this problem. For me my logic is clear enough, but eventually I can\'t submit. Always some of tests fail...\n```\nclass Solution {\npublic:\n    int longestPalindrome(vector<string>& s) {\n        unordered_map<string, int> table;\n        for (auto el : s) table[el] += 1;\n        int ans = 0; // stores amount of letters, not pairs\n        bool flag = false;\n        for (auto el : table){\n            string str = el.first;\n            int cnt = el.second;\n            if (str[0] == str[1]){\n                if (cnt % 2 == 0) ans += cnt * 2;\n                else{\n                    ans += (cnt - 1) * 2;\n                    flag = true; // Flag - if true it means that we can add "xx" word in the middle if palindrome\n                }\n            }\n            else{\n                string rev(str);\n                swap(rev[0], rev[1]);\n                int cnt2 = table[rev];\n                ans += min(cnt, cnt2) * 2; // It\'s allright if min % 2 != 0 because we will do the same for reversed word,\n\t\t\t\t// when it\'s his turn\n            }\n        }\n        return flag ? ans + 2 : ans;\n    }\n};\n```
[]