Search⌘ K
AI Features

Shortest Word Distance II

Explore how to design a custom data structure that stores an array of strings and efficiently calculates the shortest distance between any two distinct words. This lesson helps you understand the problem constraints, implement the WordDistance class, and optimize multiple queries for real-world coding interview challenges.

Statement

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