hasCycle = function(head, seen = new Set()) {
    while (head) {/* Time O(N) */
        if (seen.has(head)) return true;

        seen.add(head);/* Space O(N) */
        head = head.next;
    }

    return false;
}
https://leetcode.com/problems/linked-list-cycle/
Time O(N) | Space O(N)
@param {ListNode} head
@return {boolean}