152日目
7155 ワード
------------------------------------------🤞 My Solution -----------------------------------------
def faro_cycles(deck_size):
arche = []
left = []
right = []
temp = []
cnt = 1
for i in range(0, deck_size):
arche.append(i)
for i in range(0, int(deck_size/2)):
left.append(i)
for i in range(int(deck_size/2), deck_size):
right.append(i)
for i in range(0, int(deck_size / 2)):
temp.append(left[i])
temp.append(right[i])
while arche != temp:
left = []
right = []
for i in range(0, int(len(temp)/2)):
left.append(temp[i])
for i in range(int(len(temp)/2), len(temp)):
right.append(temp[i])
temp = []
for i in range(0, int(deck_size/2)):
temp.append(left[i])
temp.append(right[i])
cnt += 1
return cnt
Reference
この問題について(152日目), 我々は、より多くの情報をここで見つけました https://velog.io/@vivala0519/152일차-テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol