[3차] n진수 게임
def convert(n, base):
T = "0123456789ABCDEF"
q, r = divmod(n, base)
if q == 0:
return T[r]
else:
return convert(q, base) + T[r]
def solution(n = 16, t = 16, m = 2, p = 1):
answer = ''
for i in range(t*m) :
answer += convert(i, n)
return ''.join([answer[m*x+p-1] for x in range(t)])
전체 말해야할 숫자에서 자기차례 숫자만 골라내면됨