I dont know why iam getting wrong answer in this problem.Below is the link to the problem:
and my solution:
#include<iostream>
#include<cstdio>
#include<cstring>
#define FAST_IO ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
int main()
{
FAST_IO
int T;
char S[315];
scanf("%d",&T);
while(T--)
{
scanf("\n");
scanf("%[^\n]%*c", S);
int arr[26],i;
for(int i=0;i<26;i++)
arr[i]=0;
for(i=0;i<strlen(S);i++)
{
if(S[i]>=97 && S[i]<=122)
{
arr[S[i]%97]++;
}
else if(S[i]>=65 && S[i]<=90)
{
arr[S[i]%65]++;
}
}
int flag=0;
for(i=0;i<26;i++)
{
if(arr[i]==0)
{
printf("%c\n",i+97-32);
flag=1;
break;
}
}
if(flag==0)
puts("~");
}
return 0;
}