# Help me in solving AO17 problem

### My code

``````def comp(N,A,B):
alice=min(A)
bob=min(B)
total_alice=sum(A) - alice
total_bob=sum(B) - bob
if total_alice<total_bob:
return "alice"
elif total_bob<total_alice:
return "bob"
else:
return"draw"
T=int (input())
for _ in range(T):
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
result=comp(N,A,B)
print(result)
``````

Learning course: Solve Programming problems using Python
Problem Link: CodeChef: Practical coding for everyone
where is error showing

@anamtakhan3434
two mistakes first u have to subtract the max value not min value and second t loop should be in proper indentation .
i have corrected it .

``````def comp(N,A,B):
alice=max(A)
bob=max(B)
total_alice=sum(A) - alice
total_bob=sum(B) - bob
if total_alice<total_bob:
return "Alice"
elif total_bob<total_alice:
return "Bob"
else:
return"Draw"

T=int (input())
for _ in range(T):
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
result=comp(N,A,B)
print(result)
``````