Published on

프로그래머스 - 연습문제 -최고의 집합

Authors
  • avatar
    Name
    Indo Yoon
    Twitter
Table of Contents

문제

정답

아이디어가 없으면 풀 수 없는 문제 ㅜㅜ 결국 답을 보고 풀었다.

def solution(n, s):
    quotion = s // n
    remainder = s % n

    if not quotion:
        return [-1]

    answer = [quotion for _ in range(n - remainder)]

    for _ in range(remainder):
        answer.append(quotion + 1)

    return answer