Skip to content

Commit b557880

Browse files
Add Solution.go for 0083.Remove Duplicates from Sorted List
1 parent 1360e36 commit b557880

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)