Why my all test cases are not passing?

When this same code is submitted on gfg all test cases passed but here not all test cases had been passed.

@anshikapandey218,
You can try submitting on leetcode(Link), there you will even get which test case fails.

I had submitted it on leetcode all cases had been passed there .

@anshikapandey218
There can be multiple possible answers for this problem. A single input could give a lot of valid sequences. Leetcode and GFG have incorportated to check such multiple possible answers. This feature is not yet available on Hackerblocks but should be added soon. If your code passes on Leetcode then consider it solved and you can move towards the next problem.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.