Form minimum number of Palindromic Strings from a given string

  #include using namespace std;  int minimumPalindromicStrings(string S){        int N = S.length();                      vector freq(26);    for (int i = 0; i < N; i++) {        freq[S[i] - 'a']++;    }          vector oddFreqCharacters;                                for (int i = 0; i < 26; i++) {          if (freq[i] & 1) {              oddFreqCharacters.push_back(i);            freq[i]--;        }          freq[i] /= 2;    }          vector ans;              if (oddFreqCharacters.empty()) {                          string left = "";          for (int i = 0; i < 26; i++) {            for (int j = 0; j < freq[i]; j++) {                  left += char(i + 'a');            }        }          string right = left;                  reverse(right.begin(), right.end());                  ans.push_back(left + right);    }      else {                          string middle = "";        int c = oddFreqCharacters.back();        oddFreqCharacters.pop_back();        middle += char(c + 'a');                          string left = "";          for (int i = 0; i < 26; i++) {            for (int j = 0; j < freq[i]; j++) {                  left += char(i + 'a');            }        }          string right = left;                  reverse(right.begin(), right.end());                  ans.push_back(left + middle + right);                  while (!oddFreqCharacters.empty()) {              int c = oddFreqCharacters.back();            oddFreqCharacters.pop_back();            string middle = "";            middle += char(c + 'a');            ans.push_back(middle);        }    }          cout