WA in TWOSTR

I keep getting WA in TWOSTR (beginner practice prob) here is my code, can you please point out where I am wrong?
Thank You

#include <stdio.h>
#include <strings.h>
int main(void)
    {
    	int t;
    	scanf(" %d",&t);
    	while(t--)
    	    {
                char a[11], b[11];
                int i, l, flag = 1;
                scanf(" %s",a);
                scanf(" %s",b);
                l = strlen(a);
                for(i=0;i<l;i++)
                    {
                        if(a[i] != b[i])
                        {
                            if(a[i] == '?' || b[i] == '?')
                                flag = 1;
                            else
                                {
                                    flag = 0;
                                    printf("NO\n");
                                    break;
                                }
                        }
                    }
                if(flag)
                    printf("YES\n");
	    }
    	return 0;
    }

Print whats asked in the question!

The question asks to print “Yes” and “No” while you are printing “YES” and “NO”

The case of letters matters. Make sure that your output EXACTLY matches the required format.

Correct this mistake and get back to me.

1 Like

OMFG its AC xD I made such a stupid mistake even after solving questions like this before I fee l so dumb :stuck_out_tongue: Sorry for wasting your time and Thank You for helping me out :slight_smile:
Have a nice day! :smiley:

Np dear, it happens. Your logic seemed correct to me, it was then i noticed the printing line XD

Yes be cautious that you print exactly what is asked with proper: cases, spaces & new-lines where ever asked and you’ll be good ! :smiley: