Please help! WA in CODEY305

the problem (CODEY305 CodeChef: Practical coding for everyone )
is showing wrong answer in each submission of mine .
My code is (CodeChef: Practical coding for everyone). Please guide me.

Also i am surprised that all the submission to this problems in c and C++ 14 are failed in past . successful submissions are only in java .

Perhaps I’m misunderstanding the question, but what should the output be for:

1
ab ba ab ba

?

I believe it should be

ab ba ab ba

You are only required to remove “instances of words that are repeated more than once continuously

2 Likes

Good, that’s what I thought :slight_smile: The OP’s output is:

ab
1 Like

https://www.codechef.com/viewsolution/32155649
Why does this solution show WA? It seems to work for all the testcases I provided it

Also, I think there’s an empty line in the testcases, because this solution shows SIGSEGV

I can’t see anything immediately wrong with it, but it will fail if there is more than one space at the end of the first line (i.e. after the number N).

2 Likes

Ohhh, I see, thanks a lot!

sir but according to given constraint in the problem. we dont expect a double space after a line.
so, should i assume that my code( CodeChef: Practical coding for everyone ) is giving WA simply because of wrong test case in problem ?

Yours is giving the wrong answer for the testcase I posted above.

It wouldn’t surprise me if there was a bunch of extra whitespace in the testcases, either - external contests are often sloppy like that.

1 Like