#4369 Enhance UniquePaths (#4373)

* Enhance UnquiePaths DP problem solution

* Update testcases

* Linter issue resolved

* Code review comments

* Code review comments

* Code review comments

* Code review comments

---------

Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
This commit is contained in:
Manan Solanki
2023-09-14 23:15:16 +05:30
committed by GitHub
parent 34cf6dab28
commit 5bb54977fe
3 changed files with 104 additions and 83 deletions

View File

@ -1,49 +0,0 @@
package com.thealgorithms.others;
import static org.junit.jupiter.api.Assertions.*;
import com.thealgorithms.dynamicprogramming.UniquePaths;
import org.junit.jupiter.api.Test;
public class UniquePathsTests {
@Test
void testForOneElement() {
assertTrue(UniquePaths.uniquePaths(3, 7, 28));
}
@Test
void testForTwoElements() {
assertTrue(UniquePaths.uniquePaths(3, 2, 3));
}
@Test
void testForThreeElements() {
assertTrue(UniquePaths.uniquePaths(3, 3, 6));
}
@Test
void testForFourElements() {
assertTrue(UniquePaths.uniquePaths(4, 6, 56));
}
@Test
void testForFiveElements() {
assertTrue(UniquePaths.uniquePaths2(3, 5, 15));
}
@Test
void testForSixElements() {
assertTrue(UniquePaths.uniquePaths2(6, 2, 6));
}
@Test
void testForSevenElements() {
assertTrue(UniquePaths.uniquePaths2(5, 9, 495));
}
@Test
void testForEightElements() {
assertTrue(UniquePaths.uniquePaths2(4, 8, 120));
}
}