Skip to content

Commit e8f51ed

Browse files
committed
Merge branch 'master' of https://github.com/doocs/leetcode
2 parents 008eb79 + 3131175 commit e8f51ed

File tree

1 file changed

+11
-0
lines changed
  • solution/0083.Remove Duplicates from Sorted List

1 file changed

+11
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
func deleteDuplicates(head *ListNode) *ListNode {
2+
current := head
3+
for current != nil && current.Next != nil {
4+
if current.Val == current.Next.Val {
5+
current.Next = current.Next.Next
6+
} else {
7+
current = current.Next
8+
}
9+
}
10+
return head
11+
}

0 commit comments

Comments
 (0)