var hasCycle = function(head) {if (head == null || head.next == null) return false;let slower = head, faster = head;while (faster != null && faster.next != null) {slower = slower.next;faster = faster.next.next;if (slower === faster) return true;}return false;};
