劍指offer62: 圓圈中最後剩下的數---python

#coding=utf-8 import numpy as np # 環形的n個值(0~n1),一直減去第m個數,求最後剩下的數 def last_reaining_number(n, m): s = [x for x in range(n)] # 產生等差數列 p = m - 1 while len(s) != 1: # 這裏用while而不是if
相關文章
相關標籤/搜索