Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd394591

Browse files
refactor 966
1 parentf032520 commitd394591

File tree

1 file changed

+0
-44
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+0
-44
lines changed

‎src/main/java/com/fishercoder/solutions/_966.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,50 +5,6 @@
55
importjava.util.Map;
66
importjava.util.Set;
77

8-
/**
9-
* 966. Vowel Spellchecker
10-
*
11-
* Given a wordlist, we want to implement a spellchecker that converts a query word into a correct word.
12-
*
13-
* For a given query word, the spell checker handles two categories of spelling mistakes:
14-
*
15-
* Capitalization: If the query matches a word in the wordlist (case-insensitive), then the query word is returned with
16-
* the same case as the case in the wordlist.
17-
* Example: wordlist = ["yellow"], query = "YellOw": correct = "yellow"
18-
* Example: wordlist = ["Yellow"], query = "yellow": correct = "Yellow"
19-
* Example: wordlist = ["yellow"], query = "yellow": correct = "yellow"
20-
*
21-
* Vowel Errors: If after replacing the vowels ('a', 'e', 'i', 'o', 'u') of the query word with any vowel individually,
22-
* it matches a word in the wordlist (case-insensitive), then the query word is returned with the same case as the
23-
* match in the wordlist.
24-
* Example: wordlist = ["YellOw"], query = "yollow": correct = "YellOw"
25-
* Example: wordlist = ["YellOw"], query = "yeellow": correct = "" (no match)
26-
* Example: wordlist = ["YellOw"], query = "yllw": correct = "" (no match)
27-
*
28-
* In addition, the spell checker operates under the following precedence rules:
29-
*
30-
* When the query exactly matches a word in the wordlist (case-sensitive), you should return the same word back.
31-
* When the query matches a word up to capitlization, you should return the first such match in the wordlist.
32-
* When the query matches a word up to vowel errors, you should return the first such match in the wordlist.
33-
* If the query has no matches in the wordlist, you should return the empty string.
34-
*
35-
* Given some queries, return a list of words answer, where answer[i] is the correct word for query = queries[i].
36-
*
37-
* Example 1:
38-
*
39-
* Input: wordlist = ["KiTe","kite","hare","Hare"], queries = ["kite","Kite","KiTe","Hare","HARE","Hear","hear","keti","keet","keto"]
40-
* Output: ["kite","KiTe","KiTe","Hare","hare","","","KiTe","","KiTe"]
41-
*
42-
* Note:
43-
*
44-
* 1 <= wordlist.length <= 5000
45-
* 1 <= queries.length <= 5000
46-
* 1 <= wordlist[i].length <= 7
47-
* 1 <= queries[i].length <= 7
48-
* All strings in wordlist and queries consist only of english letters.
49-
*
50-
* */
51-
528
publicclass_966 {
539

5410
publicstaticclassSolution1 {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp