Search⌘ K
AI Features

Shortest Word Distance II

Explore how to implement a WordDistance class that initializes with an array of strings and supports efficient queries to find the shortest distance between any two distinct words. Understand problem constraints, design considerations, and practice your solution in a hands-on coding environment.

Statement

Design a data structure that takes in an array of strings and efficiently computes the shortest distance between ...