3
0
热心网友
var detectCycle = function(head) { if(!head)return null; let pre=head,cur=head; while(cur&&cur.next){ pre=pre.next; cur=cur.next.next; if(pre===cur){ let temp=head; while(temp!==pre){ pre=pre.next; temp=temp.next; } return pre } } return null; };
使用道具 舉報
本版積分規則 發表回覆 回帖並轉播 回帖後跳轉到最後一頁
圆梦公社,专注于为全球华人提供纯粹技术交流的地方,请勿发布任何政治及违法的言论。如有相关侵权、举报、投诉及建议等,请发 E-mail:dzh188@hotmail.com
Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.