for _ in range(int(input())):
n = int(input())
om = list(map(int, input().split()))
addy = list(map(int, input().split()))
om_streak = 0
om_max_streak = 0
addy_streak = 0
addy_max_streak = 0
for o in om:
if o!=0:
om_streak+=1
else:
if om_streak>om_max_streak:
om_max_streak=om_streak
om_streak=0
for a in addy:
if a!=0:
addy_streak+=1
else:
if addy_streak>addy_max_streak:
addy_max_streak=addy_streak
addy_streak=0
if om_max_streak > addy_max_streak:
print("OM")
elif om_max_streak < addy_max_streak:
print("Addy")
else:
print("Draw")
in this code i am creating two separate variables streak and max_streak for both addy and om then checking if they solved a problem on a day or not then adding those in streak and if he breaks his streak,then check if this streak was greater than the maximum streak till now and updating max_streak.
and then at last check the max_streak of both that who has max streak?
according to me code works fine but it is unable to pass test cases and i don’t know why so please help me regarding this.