What is the bug in this code Can anyone help me out to get the correct output : As a freelancer I picked up a Project but I got stuck with this one can anyone help me out to get this code code to get the dezired output. The Code is :

    n = int(input('\n Enter Your Value of N : '))

    answer = [[1]]
    for i in range(2, n+1):
        t = ([i]*((2*i)-3))
        answer.insert(n,t)
        for a in answer:
            a.insert(0,i)
            a.append(i)
            answerfinal = []
        for a in answer:
            answerfinal.append("".join(str(a)))
        for a in answerfinal:
            print(a)
    
The Dezired output is to be like This : 

Input : 5

Output : 

    555555555
    544444445
    543333345
    543222345
    543212345
    543222345
    543333345
    544444445
    555555555

Please help me out to get this code corrected as this is my work can anyone help????