Getting WA in problem GARDENSQ

CodeChef: Practical coding for everyone … is generating WA… i have checked for a few cases and works fine… but can’t figure out why generating wrong answer HvHw4E - Online C Compiler & Debugging Tool - Ideone.com

problem: GARDENSQ Problem - CodeChef

One thing you need to change is to make the array declaration to arr[51][51] as the string would need a place to store ‘\0’ character.It worked for me but your solution is still giving WA even after changing.Try a few more cases.

1 Like

‘\0’ is only when we take input through gets… here i am using scanf, so arr[50][50] should work perfectly… don’t know what’s still wrong with it…