Help me in solving LARGESECOND problem

My issue

nno work

My code

# cook your dish here
Q = int(input())

def solver():
    N = int(input())
    A = [int(s) for s in input().split()]
    max_num = max(A)
    for i in A: 
        if i == max_num: 
            A.remove(i)
    max_num2 = max(A)
    return max_num + max_num2

for _ in range(Q):
    print(solver())

Learning course: Arrays using Python
Problem Link: CodeChef: Practical coding for everyone

@jjessicazzhang
for test case
1
5
1 3 3 2 2
your output is 6
but correct answer would be 5