Star Trek: The Original Series was known for repeating story formulas throughout its run, but once did two very similar episodes very close together.
As the leading man and central hero of Star Trek: The Original Series, it was in the show's best interests to make William Shatner's Captain Kirk look good. And, 99% of the time, it did exactly that.
Over its many decades on our screens, Star Trek has occasionally killed off major characters only to bring them back.