We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ee00e1 commit 30c7cdfCopy full SHA for 30c7cdf
src/main/java/com/fishercoder/solutions/_206.java
@@ -41,8 +41,7 @@ public static class Solution2 {
41
* still, a null newHead proves to be very helpful.
42
*/
43
public ListNode reverseList(ListNode head) {
44
- ListNode newHead = null;
45
- return reverse(head, newHead);
+ return reverse(head, null);
46
}
47
48
ListNode reverse(ListNode head, ListNode newHead) {
0 commit comments