what's wrong with this logic/code for ERROR?

http://www.codechef.com/viewsolution/4367555

I am putting 101 or 010 in the stack. first element is put simply. But before putting the second element it checks whether it is same as the first one or not.Each time if filling gets failed I empty the stack and start filling it again.this is happening simultaneously with the input. at the end if the stack is full, that is it has 3 elements, answer is GOOD else BAD! Can anyone please help me with this…

Your logic is correct just you are printing GOOD and BAD whereas in question it is mentioned that print Good and Bad. Be careful with uppercase and lowercase letters

1 Like

thanks! What an idiot I am! :stuck_out_tongue:

1 Like

@aniket20 is absolutely right , you are printing GOOD instead of Good and BAD instead of Bad . Try uploading after correcting this error .

Happy Coding :slight_smile:

2 Likes