josephusProblem(

def josephusProblem(n, k):
    i = 0
    c = list(range(1, n + 1))
    while len(c) != 1:
        i += (k - 1)
        i %= len(c)
        del c[i]
    return c[0]

Comments

  1. The Book of Fallen - Casino Gambling
    The 오래된 토토 사이트 Book of e스포츠 Fallen is a 3-reel slot with an expanding RTP of 96.40%. The maximum payout 강인경 마루에몽 is 프로즌 먹튀 100,000 x stake 벳플릭스 (the max bet).

    ReplyDelete

Post a Comment

Popular posts from this blog

Functions in python you should know about - String.capwords()

complex number code