mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-30 07:54:05 +08:00
style: enable InvalidJavadocPosition
in checkstyle (#5237)
enable style InvalidJavadocPosition Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
This commit is contained in:

committed by
GitHub

parent
39e065437c
commit
74e51990c1
@ -8,30 +8,32 @@ import org.junit.jupiter.api.Test;
|
||||
|
||||
public class WordLadderTest {
|
||||
|
||||
/**
|
||||
* Test 1:
|
||||
* Input: beginWord = "hit", endWord = "cog", wordList =
|
||||
* ["hot","dot","dog","lot","log","cog"]
|
||||
* Output: 5
|
||||
* Explanation: One shortest transformation sequence is
|
||||
* "hit" -> "hot" -> "dot" -> "dog" -> cog"
|
||||
* which is 5 words long.
|
||||
*/
|
||||
@Test
|
||||
public void testWordLadder() {
|
||||
|
||||
/**
|
||||
* Test 1:
|
||||
* Input: beginWord = "hit", endWord = "cog", wordList =
|
||||
* ["hot","dot","dog","lot","log","cog"]
|
||||
* Output: 5
|
||||
* Explanation: One shortest transformation sequence is
|
||||
* "hit" -> "hot" -> "dot" -> "dog" -> cog"
|
||||
* which is 5 words long.
|
||||
*/
|
||||
|
||||
List<String> wordList1 = Arrays.asList("hot", "dot", "dog", "lot", "log", "cog");
|
||||
assertEquals(WordLadder.ladderLength("hit", "cog", wordList1), 5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test 2:
|
||||
* Input: beginWord = "hit", endWord = "cog", wordList =
|
||||
* ["hot","dot","dog","lot","log"]
|
||||
* Output: 0
|
||||
* Explanation: The endWord "cog" is not in wordList,
|
||||
* therefore there is no valid transformation sequence.
|
||||
*/
|
||||
/**
|
||||
* Test 2:
|
||||
* Input: beginWord = "hit", endWord = "cog", wordList =
|
||||
* ["hot","dot","dog","lot","log"]
|
||||
* Output: 0
|
||||
* Explanation: The endWord "cog" is not in wordList,
|
||||
* therefore there is no valid transformation sequence.
|
||||
*/
|
||||
@Test
|
||||
public void testWordLadder2() {
|
||||
|
||||
List<String> wordList2 = Arrays.asList("hot", "dot", "dog", "lot", "log");
|
||||
assertEquals(WordLadder.ladderLength("hit", "cog", wordList2), 0);
|
||||
|
Reference in New Issue
Block a user