style: enable InvalidJavadocPosition in checkstyle (#5237)

enable style InvalidJavadocPosition

Co-authored-by: Samuel Facchinello <samuel.facchinello@piksel.com>
This commit is contained in:
Samuel Facchinello
2024-06-18 19:34:22 +02:00
committed by GitHub
parent 39e065437c
commit 74e51990c1
37 changed files with 284 additions and 358 deletions

View File

@ -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);