'''
Find the sum of the digits of all the numbers from 1 to N (both ends included).

Examples
# N = 4
1 + 2 + 3 + 4 = 10

# N = 10
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + (1 + 0) = 46
'''
from itertools import chain
def compute_sum(n):

    return sum([int(i) for i in (list(chain(*[list(str(i)) for i in range(1,n+1)])))])

207dbe935890f2a0b95ed67adf7dbc45b5177218
<mask token>

<mask token>


def compute_sum(n):
    return sum([int(i) for i in list(chain(*[list(str(i)) for i in range(1,
        n + 1)]))])

<mask token>
from itertools import chain


def compute_sum(n):
    return sum([int(i) for i in list(chain(*[list(str(i)) for i in range(1,
        n + 1)]))])

'''
Find the sum of the digits of all the numbers from 1 to N (both ends included).

Examples
# N = 4
1 + 2 + 3 + 4 = 10

# N = 10
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + (1 + 0) = 46
'''
from itertools import chain
def compute_sum(n):

    return sum([int(i) for i in (list(chain(*[list(str(i)) for i in range(1,n+1)])))])
