buy 1 get 1 .... can any 1 find bug ?? wrong answer

#include
#include
using namespace std;

int main() {

char str[200];
int arr[200][2]={},count, i , found , sum,t;

scanf("%d\n",&t);
while(t--)
{

	scanf("%s",&str);
	i=0;
	count=0;
	while(str[i]!=NULL)
	{
		found=0;
		for(int j=0 ; j<count ; j++)
		{
			if( (int)str[i] == arr[j][0] )
			{
					
				arr[j][1]+=1;
				found=1;
				break;
			}
			
		}
		
		if(!found)
		{
			
			arr[count][0]= str[i];
			arr[count][1] =1;
			count++;
		}
		i++;
	}
	
	sum=0;
	
	for(i=0 ; i<count ;i++)
	{
		sum+=(arr[i][1]+1)/2;
	}
	
	printf("%d\n",sum);
	//memset(arr,0,sizeof(arr));
}
return 0;

}

ABOVE CODE IS RUNNING EACH TEST CASE GIVEN BUT STILL CODE CHEF IS NOT ACCEPTING THE CODE