题解 | #孩子们的游戏(圆圈中最后剩下的数)#
孩子们的游戏(圆圈中最后剩下的数)
http://www.nowcoder.com/practice/f78a359491e64a50bce2d89cff857eb6
public class Solution { public int LastRemaining_Solution(int n, int m) { if(n<=0) return -1; if(m<=0) return -1; return (LastRemaining_Solution(n-1,m)+m)%n; } }