【leetcode】142.(Medium)Linked List Cycle II

解题思路: 第一种做法:维护一个map 第二种做法:双指针(做法来自题目后面讨论区) 提交代码:维护map class Solution { public ListNode detectCycle(ListNode head) { if(head==null||head.next==null) return null; Map<ListNode,
相关文章
相关标签/搜索