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.
Delete duplicate-value nodes from a sorted linked list
Delete duplicate-value nodes from a sorted linked list
Sort by
recency
|
922 Discussions
|
Please Login in order to post a comment
My Java 8 Solution
This C++ solution mirrors the Python logic and is clean, robust, and handles corner cases well (e.g., duplicates at the start). Memory is handled with a dummy pointer to help simplify pointer rewiring. Betbricks7 com sign up
Hello I tried to solve this with kotlin cause Im Software android Engineer and I feel more familiar with kotlin
My logic is correct but Hacker rank has a kind of bug working with nulleables types the same logic in python works correctly why?
My Java solution with o(n) time complexity and o(1) space complexity:
def removeDuplicates(llist): # Write your code here var=llist while var: if var.next and var.data == var.next.data: var.next = var.next.next else: var = var.next return llist