I'm getting some test cases wrong - pancake sorting
So fixing anything in the code will help or the setters need to change the test cases ?
@nidhigupta847
setter needs to change
like one of the test case is this
2
7
1 8 5 4 3 9 2
6
8 7 6 4 6 4
So suppose if an element is already at its proper position then do we need to include its no of flip as 1 or we do not include it ??
And even for the test case that u’ve specified
2
7
1 8 5 4 3 9 2
6
8 7 6 4 6 4
my output is:
6 7 3 6 3 5
1 6 2 4 1 3 1 2
which i guess is correct. let me know whether it is correct or not.
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.
U said the setter needs to change the test cases. What happened ? Has the test cases changed ??
Let me check wait. .
@nidhigupta847 try submitting here.
this link is added to the problem statement
if your code works on this its correct
Its getting accepted on leetcode. Its been so many days i’ve been complaining about the testcases being wrong why no action is being taken ?? I’m literally going on wasting my time because of this.
@nidhigupta847
Actually this problem can have multiple correct outputs
But on hackerblocks only the outputs which matches with the problem setter’s output are accepted
That’s why leetcode’s link is given in the problem, so you can submit there
So in short -
Test cases are correct, but your solution isn’t getting accepted bcz your output isn’t exactly matching the problem setter’s output. So, it’s not a problem, if it’s accepted at leetcode then your solution is good to go.