Skip to content

Instantly share code, notes, and snippets.

@YOUNGJUN2
Created December 13, 2019 10:24
Show Gist options
  • Save YOUNGJUN2/6f82d209736e09febab6a3a4f268809e to your computer and use it in GitHub Desktop.
Save YOUNGJUN2/6f82d209736e09febab6a3a4f268809e to your computer and use it in GitHub Desktop.
def solution(numbers):
answer = ''
l=[]
for i in numbers:
a=str(i)
if len(a)==4:
b=a*1
b=b[0:4]
if len(a)==3:
b=a*2
b=b[0:4]
if len(a)==2:
b=a*2
b=b[0:4]
if len(a)==1:
b=a*4
l.append([b,a])
l.sort(reverse=True)
for i in l:
answer+=i[1]
if sum(numbers)==0:
answer='0'
return answer
# https://programmers.co.kr/learn/courses/30/lessons/42746
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment