seniors tend to take longer than juniors to write the same algorithm simply because they tend to get sidetracked by things like properly structuring code, beautifying their work, error handling, logging, etc. etc.. All of which are required for a stable, maintainable, solution but irrelevant to the actual core functionality.

So I'm not surprised that more experienced people take longer than beginners at writing that code, they go about it like a production problem rather than a plaything.