Japt -g
, 16 14 bytes
x_o *3x_Ì*3)nZonZg1)*Zo*ZÎ
Try it onlineTry it or verify all test casesverify all test cases.
Port of @AndrovT's Vyxal answer. Takes -1 for A and 1 for B. Outputs 1 for A, -1 for B, and 0 for draw.
x_o *3x_Ì*3)nZonZg1)*Zo*ZÎ implicit input array
x_ sum after mapping each to:
o *3Ì*3) pop hitsthe andlast multiplyitem by(hits) three
* 3
nZonZg1) subtractsubtracted from {popthe second item (time})
*Zo*ZÎ multiplymultiplied by {popfirst item
(A or B, -1 for A and 1 for B})
end sum. -g flag: output sign of the number