Like this:
https://news.ycombinator.com/item?id=26205064
There are going to be false negatives due to semantically exact dupes that are not exactly the same URL. Even the same URL can be spelled differently; e.g. trailing backslash or not, domain redirects, URL encoding.
Still, it seems worth having some sort of similarity function which at least warns the user with an extra prompt.
Your example is a false negative due to differing URLs. (One of them points to old reddit.)
There are other more important forces at play and it’s best to give them a chance to play out.