UVa 11283 - Playing Boggle

My solution

I can’t understand why my solution is giving WA even I tried random cases with a AC solution (on github)

There is a tiny mistake in your score() function.

int score(int x){
        return 1;
    else if(x>3 and x<7)
        return x-3;
    else if(x==7)
        return 5;
        return 11;

Just replace it with above, you will get AC.

You just need to fix score() function. Its not giving expected output for score(7)

Link to my code https://codepad.co/snippet/6SEoiyCa

Thanks @bansal1232

My silly mistakes -.-