Search⌘ K
AI Features

Shortest Word Distance II

Understand how to design a data structure in Go for efficiently computing the shortest distance between any two different words in an array. Learn to implement the WordDistance class with methods for initialization and distance querying, optimizing for multiple calls and practical constraints.

Statement

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