• + 0 comments

    Since this is looking for a solution without using any strings, I think even list concatenation doesn't count as a valid one. I think they are expecting more or less something along the lines of:

    if __name__ == '__main__':
        n = int(input())
        a = 0;
        for i in range(1, n+1):
            if (i > 99):
                a = a*1000 + i
            elif (i > 9):
                a = a*100 + i
            else:
                a = a*10 + i
        
        print(a)