I optimized the script and it now matches the given solution.
Fortunately, with the given example, my solution was slower and the right answer could be given by either party. The quickest would have known on day 5 so would call it correctly.
Got out of jail free that time. That will teach me to get all excited and prematurely shout out.
The script:-
Day 1: If you see 11, 12, or 13 then call 13. (Duh!)
Day 2: If you see 0, 1, or 2 then call 10. The other person is seeing 10, 9, or 8. If they saw 13, 12, or 11 they would have called at day 1.
Day 3: If you see 8, 9, or 10 then call 13. The other person is seeing 5, 4, or 3. If they saw 2, 1, or 0 they would have called at day 2.
Day 4: If you see 3, 4, or 5 then call 10. The other person is seeing 7, 6, or 5. If they saw 10, 9, or 8 they would have called at day 3.
Day 5: You will see 6 or 7 so will your partner. Either call 13 because 4 and 3 would have been called on day 4.