온코더 레벨 6 셀프넘버 판별
·
코테 문제 풀이/온코더 oncoder
class Solution: def solution(self, a): self.a = a self.sum = 0 self.res=[] for i in range(1,self.a+1): self.sum=i for j in range(0,len(str(i))): self.sum += int(str(i)[j]) self.res.append(str(self.sum)) return self.res.count(str(a)) cs 출처 : www.oncoder.com/