剑指 Offer 62. 圆圈中最后剩下的数字 class Solution: def lastRemaining(self, n: int, m: int) -> int: f = 0 for i in range(2, n+1): f = (f + m) % i return f