LCPESY : Getting WA

c
lcpesy
practice

#1

Please help me find what is wrong with this code

`#include<stdio.h>
#define size 10000
#define ascii 123

int main(){
int t,j;
char a[size];
char b[size];
int a1[ascii],b1[ascii];
long long int i,sum;

scanf("%d",&t);
for(j=0;j<t;j++){
sum=0;
memset(a1, 0, ascii*sizeof(a1));
memset(b1, 0, ascii
sizeof(*b1));

    scanf("%s",&a);
    scanf("%s",&b);

        i=0;
        while(a* != 0){
            a1[a*]++;
            i++;
        }

        i=0;
        while(b* != 0){
            b1[b*]++;
            i++;
        }
        for(i=65;i<123;i++){
                if(a1*>0 && b1*>0){
                    if(a1*<b1*){
                        sum=sum+a1*;
                    }

                    else{
                        sum=sum+b1*;
                    }
                }

        }
        printf("%lld

",sum);

}
 return 0;

}
`


#2

size should be 10001 to accommodate the '\0' at the end when |A| or |B| = 10000

Accepted submission:
http://www.codechef.com/viewsolution/3932332


#3

Request you to continue the discussion on the editorial page of the problem. Closing this question as of now.