this code is working fine when custom input is applied but it is giving wrong answer when i submit it. please tell me whats wring with it?
Even-After-Odd doubt
Hi @Shreya-Gupta-2383169445069382, the order of odd linked list is not correct in your code.
For example, consider the test case
5
1 3 5 7 9
Output should be 1 3 5 7 9
Your code gives output: 9 5 7 3 1
I hope now you know what’s wrong with your code. Try to rectify the error.
If doubt still persists, reply to this thread, else mark it as resolved.
why is the order important? and how am i supposed to do that?
@Shreya-Gupta-2383169445069382 The order is important because that’s the order of the input. You’re supposed to maintain it. Else your output won’t match the desired output. Try to figure out the logic. If you need hints, let me know.
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.