Wrong answer for Lapindromes; even though all the test cases are passing!

#include<bits/stdc++.h>
using namespace std;
void lapindrome(string a){
int mid=0;
int count=0;
if(a.size()%2==0){
mid = a.size()/2;
for(int i=0; i<mid; i++){
for(int j=mid; j!=(a.size()); j++){
if(a[i]==a[j]){
count=count+1;
}

            else{
                continue;
            }
        }
    }
    if(count==mid){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }
}

else{
    mid = (a.size()+1)/2;
    for(int i=0; i<(mid-1); i++){
        for(int j=mid; j!=(a.size()); j++){
            if(a[i]==a[j]){
                count=count+1;
            }

            else{
                continue;
            }
        }
    } 
    if(count==(mid-1)){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }

}

}

int main(){
string S=" ";
int T=0;
cin>>T;
while(T–){
cin>>S;
lapindrome(S);

}

return 0;

}
//Somebody pls help me realize what’s wrong in this code…

You are checking for equality of each character in both sub-strings. But you are supposed to check only the frequency of characters (all characters in each sub-string including those that are present on one sub-string and not the other in which case the answer would NO).

I dont know the exact test cases where my code is failing, you can run any string and it is giving correct output but still WA.

#include <bits/stdc++.h>
using namespace std;

int main() {
int t;
cin>>t;
while(t–){
string s;
cin>>s;
int sum=0, sum1=0;
int a = s.length();
if(a>=2&&a<=1000){
vector v(s.begin(),s.end());
for(int i=0,j=a-1;i<j;i++,j–){
sum+=v[i];
sum1+=v[j];
}
if(sum==sum1) cout<<“YES”<<endl;
else cout<<“NO”<<endl;
}
else continue;
}
return 0;
}

Δεν είναι μόνο ένα αθλητικό στοίχημα, αλλά οι παίκτες μπορούν επίσης να λάβουν μέρος σε ένα ζωντανό καζίνο ή σε παιχνίδια καζίνο όπως κουλοχέρηδες, μπλακτζάκ ή ρουλέτα και να λάβουν ανταμοιβές. Το 22bet bitcoin δέχεται όλα τα σημαντικά κρυπτογραφικά και εικονικά νομίσματα. Μπορείτε να λάβετε ένα μπόνους καλωσορίσματος 100%, μπόνους πρώτης κατάθεσης ή μπόνους επαναφόρτωσης της Παρασκευής.