标签:for shu ref ems turn solution sheng leetcode public
题目链接:https://leetcode-cn.com/problems/yuan-quan-zhong-zui-hou-sheng-xia-de-shu-zi-lcof/
class Solution {
public:
int lastRemaining(int n, int m) {
int ans = 0;
for(int i = 2; i <= n; i++)
ans = (ans + m) % i;
return ans;
}
};
标签:for shu ref ems turn solution sheng leetcode public
原文地址:https://www.cnblogs.com/Trevo/p/12731237.html