diff --git a/142. Linked List Cycle II/Solution.cs b/142. Linked List Cycle II/Solution.cs index d7f9698..f973b8d 100644 --- a/142. Linked List Cycle II/Solution.cs +++ b/142. Linked List Cycle II/Solution.cs @@ -4,6 +4,8 @@ public class Solution { public ListNode? DetectCycle(ListNode head) { + if(head == null) + return null; ListNode? cur = head; int bit = 1 << 28; int curAbs = 0;