You are viewing a single comment's thread. Return to all comments →
My Code:
public static Node Reverse(Node head) { var previous = (Node)null; while (head != null) { var t = head.Next; head.Next = previous; previous = head; head = t; } return previous; }
**My Output:
Your code did not pass this test case.
Input (stdin)
2
4
1 2 3 4
5
2 3 4 5 6
Your Output (stdout)
4 3 2 1
Right Answer!
6 5 4 3 2
Expected Output
Compiler Message
Wrong Answer**
I suspect there is a leftover output in the solution checker.
Seems like cookies are disabled on this browser, please enable them to open this website
Reverse a linked list
You are viewing a single comment's thread. Return to all comments →
My Code:
**My Output:
Your code did not pass this test case.
Input (stdin)
2
4
1 2 3 4
5
2 3 4 5 6
Your Output (stdout)
4 3 2 1
4 3 2 1
Right Answer!
6 5 4 3 2
6 5 4 3 2
Right Answer!
Expected Output
Right Answer!
Right Answer!
Compiler Message
Wrong Answer**
I suspect there is a leftover output in the solution checker.