here is my python code:----

a=input()

n=len(a)

A = [1000000007 for i in range(n)]

A[0] = 0

for i in range(n-1):

for j in range(i+1,n):

if j == i+1 or a[j] == a[i]:

A[j] = min(A[i]+1, A[j])

A[j-1] = min(A[j]+1, A[j-1])

print(A[n-1])

Please suggest me what’s wrong with my code