From e31390f0a0f5f75ef31968020b62d37fe85d0c5e Mon Sep 17 00:00:00 2001 From: Omkarnath Parida Date: Sun, 4 Oct 2020 23:55:40 +0530 Subject: [PATCH] Added Dummy head to avoid Undefined Error --- Data-Structures/Linked-List/CycleDetection.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Data-Structures/Linked-List/CycleDetection.js b/Data-Structures/Linked-List/CycleDetection.js index ff07bca60..b8e16fe71 100644 --- a/Data-Structures/Linked-List/CycleDetection.js +++ b/Data-Structures/Linked-List/CycleDetection.js @@ -15,6 +15,7 @@ function main () { Link for the Problem: https://leetcode.com/problems/linked-list-cycle/ */ + const head = '' // Reference to head is given in the problem. So please ignore this line let fast = head let slow = head