My problem is that he still hasn't explained in English what he expects the result to be. I told him specifically NOT to explain it in code and that's what he did... Write code.
So without understanding his logic behind his expected solution, I'm not even going to try to figure out the answer. The coded result just doesn't make sense to me given the data he provided.