var hasCycle = function(head) {
if (!head) return false; // empty
let slow = head, fast = head
while (fast.next && fast.next.next) {
console.log("key")
fast = fast.next.next
slow = slow.next
if(fast === slow) return true
}
return false
};