728x90
반응형
문제 출처: https://school.programmers.co.kr/learn/courses/30/lessons/12924
풀이:
def solution(s):
res = 0
s = int(s)
for i in range(1, s+1):
count = 0
for j in range(i, s+1):
count += j
if count == s:
res += 1
break
elif count > s:
break
return res
반응형
댓글