You are viewing a single comment's thread. Return to all comments →
In Kotlin:
fun removeDuplicates(llist: SinglyLinkedListNode?): SinglyLinkedListNode? { var current = llist; while (current != null && current.next != null) { if (current.data == current?.next?.data) { current.next = current?.next?.next; } else { current = current?.next } } return llist }
But I does not work in some tests. I think it is the compiler bug.
Seems like cookies are disabled on this browser, please enable them to open this website
Delete duplicate-value nodes from a sorted linked list
You are viewing a single comment's thread. Return to all comments →
In Kotlin:
But I does not work in some tests. I think it is the compiler bug.