From c388b14c3f5f2439643d20a73229bf84d378567c Mon Sep 17 00:00:00 2001 From: Electrominch <64524860+Electrominch@users.noreply.github.com> Date: Thu, 6 Oct 2022 03:12:43 +0300 Subject: [PATCH] Fix 142 --- 142. Linked List Cycle II/Solution.cs | 2 ++ 1 file changed, 2 insertions(+) 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;