Skip to content

Commit 04614b1

Browse files
update 109
1 parent 45778a5 commit 04614b1

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

Diff for: src/main/java/com/fishercoder/solutions/firstthousand/_109.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ public TreeNode toBstRecursively(ListNode start, ListNode end) {
1515
} else {
1616
ListNode slow = start;
1717
ListNode fast = start;
18-
while (fast != end && fast.next != end) {//here is the key: we check if fast != end, not fast != null
18+
//here is the key: we check if fast != end, not fast != null
19+
while (fast != end && fast.next != end) {
1920
slow = slow.next;
2021
fast = fast.next.next;
2122
}

0 commit comments

Comments
 (0)