Need boundary test cases for the problem "Little Elephant and Order".

I have tried all sort of test cases possible that I could think of and got correct answer. But when I submit it, I get wrong answer error. Can someone tell me what test case I am missing?

Following are the test cases I have tried:
A=4444 B=4545
A=7777 B=4444
A=888 B=777
A=333 B=222
A=555 B=444
A=8743275 B=7594127

You solution is logically correct.
But you should learn carefully how C/C++ deals with strings represented by arrays of chars.
After changing 20000 to 20001 in definition of A and B got AC:

1 Like