please give me a test case where my code fails
Few things :
1)Online judges are case sensitive so you should be printing “Good” and not ‘good’. Same goes for “bad”.
-
size of str should be maximum length + 1 i.e. 100001 and not 10000.You need 1 extra space for ‘\0’
-
Keep the habit of writing int main and also a return 0; at the end.This might not be the default for all online judges so always write it explicitly.
-
Your code gives wrong answer for the test case : 10010. Answer should be ‘Good’ but your code gives ‘Bad’ as output.