Skip to content

Commit 426c041

Browse files
refactor 83
1 parent 48d17b0 commit 426c041

File tree

1 file changed

+3
-3
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+3
-3
lines changed

src/main/java/com/fishercoder/solutions/_83.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
public class _83 {
66
public static class Solution1 {
77
public ListNode deleteDuplicates(ListNode head) {
8-
ListNode ret = new ListNode(-1);
9-
ret.next = head;
8+
ListNode pre = new ListNode(-1);
9+
pre.next = head;
1010
while (head != null) {
1111
while (head.next != null && head.next.val == head.val) {
1212
head.next = head.next.next;
1313
}
1414
head = head.next;
1515
}
16-
return ret.next;
16+
return pre.next;
1717
}
1818
}
1919

0 commit comments

Comments
 (0)