通过环形链表模拟,解决这道题,时间复杂度O(mn),如果m,n太大,时间太长。 class Solution: def LastRemaining_Solution(self, n, m): # write code here result=head=ListNode(0) i=0 if n==0 or m==0: return -1 while i<n: node=ListNode(i) head.next=node ...