๋ฌธ์
https://school.programmers.co.kr/learn/courses/30/lessons/134240
ํ์ด
# ํ๋ก๊ทธ๋๋จธ์ค 1๋จ๊ณ - ํธ๋ ํ์ดํธ ๋ํ
def solution(food):
answer = ''
res = ''
for i in range(1, len(food)):
if food[i] >= 2:
res += (food[i]//2)*str(i)
answer = res + str(0) + res[::-1]
return answer
print(solution([1,3,4,6]))
'๐๏ธ Algorithm > โฌ ํ๋ก๊ทธ๋๋จธ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
โฌ [Programmers] [Python] [Level1] ์์ ์ฐพ๊ธฐ (0) | 2023.04.10 |
---|---|
โฌ [Programmers] [Python] [Level1] ๊ฐ์ฅ ๊ฐ๊น์ด ๊ฐ์ ๊ธ์ (0) | 2023.04.10 |
โฌ [Programmers] [Python] [Level1] ์ผ์ด์ฌ (0) | 2023.04.10 |
โฌ [Programmers] [Python] [Level1] ์ด์ํ ๋ฌธ์ ๋ง๋ค๊ธฐ (0) | 2023.04.10 |
โฌ [Programmers] [Python] [Level1] ๋ฌธ์์ด ๋ด ๋ง์๋๋ก ์ ๋ ฌํ๊ธฐ (0) | 2023.04.10 |