Skip to content

Commit 23a3954

Browse files
committed
[PGS] 푸드 파이트 대회 / lv20 / 20분
https://school.programmers.co.kr/learn/courses/30/lessons/134240
1 parent d84b2bb commit 23a3954

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
def solution(food):
2+
answer = ''
3+
# 1. find sub that is one person will eat order
4+
sub = ""
5+
re_sub = ""
6+
count =0
7+
for i in range(1, len(food)):
8+
count = food[i]//2
9+
for j in range(count):
10+
sub+=str(i)
11+
for k in sub[::-1]:
12+
re_sub += k
13+
14+
answer = sub + "0" + re_sub
15+
16+
return answer

0 commit comments

Comments
 (0)