Solutions for sum up to exactly 10

    • @JavierVow
    • @jacob, submitted in Python 2, achived 100% score
    def solve(n):
        tmp_sum = 0
        for char in str(n):
            tmp_sum += int(char)
    
        return (n * 10) + (10 - tmp_sum)
    • @JavierVow
    • @jacob, submitted in Python 3, achived 100% score
    def solve(n):
        tmp_sum = 0
        for char in str(n):
            tmp_sum += int(char)
    
        return (n * 10) + (10 - tmp_sum)