We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Reverse a doubly linked list
- Discussions
Reverse a doubly linked list
Reverse a doubly linked list
Sort by
recency
|
39 Discussions
|
Please Login in order to post a comment
Java
Recursive approach
The evaluation code, which is unchangeable, is broken in Kotlin. The printing code is this:
There is no new line between test cases. If an input has more than one test case, it will all be printed in the same line failing the submission. I had to declare this global variable
"var testCasesSoFar = 0"
and then put in my function this code:and this made the code pass.
Solution in Java 15: