Skip to content

Instantly share code, notes, and snippets.

@yuda110
Created June 2, 2016 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuda110/5e86162ff8b0f697ff87d105f7048d6f to your computer and use it in GitHub Desktop.
Save yuda110/5e86162ff8b0f697ff87d105f7048d6f to your computer and use it in GitHub Desktop.
from itertools import product
def change124(n):
count = 1
digit = 1
while count != n :
for i in product('124', repeat=digit):
cur_num = ''.join(i)
if count == n :
break
count += 1
digit += 1
return cur_num
# 아래는 테스트로 출력해 보기 위한 코드입니다.
print(change124(10))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment