In Star Trek II: The no win scenario that all starfleet commanders faced upon leaving the academy. There is no way to beat the simulation to see how a commander can cope with such a scenario.
However, Captain Kirk got a medal of ingenuity from Starfleet by beating the simulation by reprogramming the computer to have a situation in which he could win.
It's the only known solution and noone has been able to reproduce it but Kirk.
A kobiashimaru- when a guy loses a girl and it's his fault- and he absolutely can't get her back and its tearing him apart- but he has noone to blame but himself.