244. Shortest Word Distance II
244. Shortest Word Distance II
Description
Design a data structure that will be initialized with a string array, and then it should answer queries of the shortest distance between two different strings from the array.
244. Shortest Word Distance II
Design a data structure that will be initialized with a string array, and then it should answer queries of the shortest distance between two different strings from the array.
2385. Amount of Time for Binary Tree to Be Infected
You are given the root of a binary tree with unique values, and an integer start. At minute 0, an infection starts from the node with value start.
871. Minimum Number of Refueling Stops
A car travels from a starting position to a destination which is target miles east of the starting position.
2268. Minimum Number of Keypresses
You have a keypad with 9 buttons, numbered from 1 to 9, each mapped to lowercase English letters. You can choose which characters each button is matched to as long as:
2589. Minimum Time to Complete All Tasks
There is a computer that can run an unlimited number of tasks at the same time . You are given a 2D integer array tasks where tasks[i] = [starti, endi, durationi] indicates that the i^th task should run for a total of durationi seconds (not necessarily continuous) within the inclusive time range [starti, endi].
2097. Valid Arrangement of Pairs
You are given a 0-indexed 2D integer array pairs where pairs[i] = [starti, endi]. An arrangement of pairs is valid if for every index i where 1 <= i < pairs.length, we have endi-1 == starti.