You are viewing a single comment's thread. Return to all comments →
Kotlin test cases where t > 1 fail because no newline is printed after each call to printDoublyLinkedList().
printDoublyLinkedList()
Same for Insert Node at Specific Position.
I think this would fix it (if main were editable) - see addition of println() at end.
main
println()
fun main(args: Array<String>) { val scan = Scanner(System.`in`) val t = scan.nextLine().trim().toInt() for (tItr in 1..t) { val llistCount = scan.nextLine().trim().toInt() val llist = DoublyLinkedList() for (i in 0 until llistCount) { val llist_item = scan.nextLine().trim().toInt() llist.insertNode(llist_item) } val llist1 = reverse(llist?.head) printDoublyLinkedList(llist1, " ") // SHOULD INSERT NEWLINE HERE: println() } }
Please fix this
Seems like cookies are disabled on this browser, please enable them to open this website
Reverse a doubly linked list
You are viewing a single comment's thread. Return to all comments →
Kotlin test cases where t > 1 fail because no newline is printed after each call to
printDoublyLinkedList()
.Same for Insert Node at Specific Position.
I think this would fix it (if
main
were editable) - see addition ofprintln()
at end.Please fix this