Problem 245 · Medium

Shortest Word Distance III

Find shortest distance between any two distinct words (even if they're the same).

Open the interactive visualisation