To have loved and lost. Because, in the final analysis, there was no loss, only gain.
When we meet someone amazing who we are connected to, we grow and so do they. We are both enriched permanently.
It stings tremendously when they leave. But when we learn to let go of the past that had them in it and just embrace what we had already gotten from them, we learn that everything we are is better off for having met them.