Approach Explanation (* ̄▽ ̄)/
- Because the list is sorted, duplicates will always be adjacent.
- I traversed the list using a pointer curr.
- If curr.data == curr.next.data, I skipped the duplicate node by reassigning curr.next.
- Otherwise, I moved forward.
- At the end, only one copy of each value remained.
Method Used: (〜 ̄▽ ̄)〜
- Single traversal
- Pointer adjustment
- No extra space

Top comments (0)