Can anyone remember the episode/film from this idea snippet - eviltoast

The Doctor and another time traveler (the master?) were talking to each other about who went back in time earlier and set up or undid traps for the other one, over several iterations

things like : Well I went back in time further before you set up that trap and undid it and placed my own

I knew you’d do that so I went even futher… etc etc