COVID19B unknown error

Can someone tell why my code is not working.
My logic is that the one who is behind and is faster then the ones ahead of him would get in contact with them while overtaking them.
My Solution

consider example
4 3 5 1 in this case your code give min=2 max=4 correct answer is min =3 max=4
as your code is considering min by 5 in which 5 and 1 get infected but 4 and 3 would also get infected as 1 is infected and 4 and 3 have more speed than him
by 4 by 3 by 5 by 1
max=3 max=3 max=4 max=4

1 Like

Yeah, same. That will be the case.
Plus you should consider time as well to keep track of whether there can be more crossing among other runners after the time when two runners come in contact and get infected.