Skip to content

Commit 859b232

Browse files
committed
[PGS] 최고의 집합 / Level3 / ?분
1 parent 29e3703 commit 859b232

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def solution(n, s):
2+
if n > s:
3+
return [-1]
4+
answer = [1] * n
5+
6+
a, b = divmod(s, n)
7+
answer = [a]* n
8+
for i in range(b):
9+
answer[i % n] += 1
10+
11+
#print(answer)
12+
answer.sort()
13+
return answer

0 commit comments

Comments
 (0)