https://www.codechef.com/viewsolution/26754687
this solution of problem MATCHES should be right but codechef is giving WA.
Your code has a typo… for d=0 you are adding 8 when you are suppose to add 6 only… correct this and you are good to go !
2 Likes
Just replace it::
if(d == 0)
s += 6;
1 Like