Created
December 13, 2019 10:24
-
-
Save YOUNGJUN2/6f82d209736e09febab6a3a4f268809e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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