141.环形链表
题解:只要总体没有出现null就行了
var hasCycle = function(head) {let f = head, s = head;while(f != null && f.next != null) {s = s.next;f = f.next.next;if(s == f) return true;}return false;
};
题解:只要总体没有出现null就行了
var hasCycle = function(head) {let f = head, s = head;while(f != null && f.next != null) {s = s.next;f = f.next.next;if(s == f) return true;}return false;
};