Skip to content

[Feature]: Add 245. Shortest Word Distance III solution  #3890

Closed
@sivaprasath2004

Description

@sivaprasath2004

Is there an existing issue for this?

  • I have searched the existing issues

Feature Description

245.Shortest Word Distance III (Premium / Problem)

  • Given an array of strings wordsDict and two strings that already exist in the array word1 and word2, return the shortest distance between the occurrence of these two words in the list.

  • Note that word1 and word2 may be the same. It is guaranteed that they represent two individual words in the list.

Example 1:
- Input: wordsDict = [“practice”, “makes”, “perfect”, “coding”, “makes”], word1 = “makes”, word2 = “coding”
- Output: 1

Example 2:
- Input: wordsDict = [“practice”, “makes”, “perfect”, “coding”, “makes”], word1 = “makes”, word2 = “makes”
- Output: 3

Constraints:

1 <= wordsDict.length <= 105
1 <= wordsDict[i].length <= 10

Use Case

-please assign me..

Benefits

No response

Add ScreenShots

No response

Priority

High

Record

  • I have read the Contributing Guidelines
  • I'm a GSSOC'24 contributor
  • I have starred the repository

Metadata

Metadata

Labels

CodeHarborHub - Thanks for creating an issue!GSSOC'24GirlScript Summer of Code | Contributordsa-solutionLabel for solutions related to Data Structures & Algorithms.gssocGirlScript Summer of Code | Contributorlevel1GirlScript Summer of Code | Contributor's Levels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions