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 45778a5 commit 04614b1Copy full SHA for 04614b1
src/main/java/com/fishercoder/solutions/firstthousand/_109.java
@@ -15,7 +15,8 @@ public TreeNode toBstRecursively(ListNode start, ListNode end) {
15
} else {
16
ListNode slow = start;
17
ListNode fast = start;
18
- while (fast != end && fast.next != end) {//here is the key: we check if fast != end, not fast != null
+ //here is the key: we check if fast != end, not fast != null
19
+ while (fast != end && fast.next != end) {
20
slow = slow.next;
21
fast = fast.next.next;
22
}
0 commit comments