Method
lastRemaining2
模拟链表, 假设当前删除的位置是 idx,下一个删除的数字的位置是 idx + m。 但是,由于把当前位置的数字删除了,后面的数字会前移一位,所以实际的下一个位置是 idx + m - 1。 由于数到末尾会从头继续数,所以最后取模一下,就是 (idx + m - 1) (mod n)。 @param n @param m @return last
(int n, int m)
Source from the content-addressed store, hash-verified
source not stored for this graph (policy: none)
Callers
nothing calls this directly
Tested by
no test coverage detected