dont know why Buy1-Get1 gives Wrong Answer...help me out with some input that gives wrong output..please.

import java.io.*;
import java.util.*;
public class Main{
public static void main(String[] args) throws IOException{

BufferedReader s=new BufferedReader (new InputStreamReader(System.in));
int t=Integer.valueOf(s.readLine());
for(int i=0;i&ltt;i++){
String[] jewl=s.readLine().split("");
int cost=0;
String[] store=new String[jewl.length];
ArrayList stores=new ArrayList();
int cc=0;
for(int j=1;j&ltjewl.length;j++){
String jewel=jewl[j];
stores.add(jewel);
int[] rr=is_stored(jewel,stores);
int count=rr[1];
if(rr[0]==1){
if(count%2==1){cost++;}
}else{
cost++;
}

}
System.out.println(cost);
}

}



static int[] is_stored(String jewel,ArrayList store){
int count=0;
int no_value_matched=0;
int[] mix=new int[2];
for(int i=0;i&ltstore.size();i++){
if(store.get(i).equals(jewel)){
count++;
no_value_matched=1;
}
}
mix[0]=no_value_matched;
mix[1]=count;
return mix;
}


}