About simple queries

What’s wrong with my solution???

class Solution:
# @param A : list of integers
# @param B : list of integers
# @return a list of integers
def solve(self, A, B):
b=[[]]
for i in range(len(A)):
for j in range(i+1,len(A)+1):
sub=A[i:j]
b.append(sub)
b.remove(b[0])

    new=[]
    for i in range(len(b)):
        new.append(max(b[i]))
    
    ans=[]
    ans1=1
    for i in range(len(new)):
        for j in range(1,new[i]+1):
            if(new[i]%j==0):
                ans1=ans1*j
        ans.append(ans1)
        ans1=1
    ans.sort(reverse=True)
    return(ans)
Click here to start solving coding interview questions