Skip to content

Commit 30c7cdf

Browse files
refactor 206
1 parent 5ee00e1 commit 30c7cdf

File tree

1 file changed

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

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ public static class Solution2 {
4141
* still, a null newHead proves to be very helpful.
4242
*/
4343
public ListNode reverseList(ListNode head) {
44-
ListNode newHead = null;
45-
return reverse(head, newHead);
44+
return reverse(head, null);
4645
}
4746

4847
ListNode reverse(ListNode head, ListNode newHead) {

0 commit comments

Comments
 (0)