Help me in solving ABSTRING problem

My issue

why this the while loop is not work it only print 1st condition answer

My code

#include <stdio.h>

int main(void) {
	// your code goes here
	int t;
	scanf("%d",&t);
while(t--)
	{ 
	    int n,x,i;
	    scanf("%d",&n);
	    char s[n];
	    scanf("%s",s);
	    if (n%2!=0)
	    break;
	    else{
	        for(i=0;i<n;i++){
	            for(int j=0;j<n;j++){
	                if(s[i]==s[j])
	                x++;
	                }
	                if (x%2!=0)
	                break;    
	    }
	    }
	    if(i==n)
	    puts("YES");
	    else
	    puts("NO");
	}
	return 0;
}


Problem Link: ABSTRING Problem - CodeChef