mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-27 14:34:05 +08:00
Add Josephus Problem Recursive Solution (#3208)
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class JosephusProblemTest {
|
||||
|
||||
@Test
|
||||
void testJosephusProblem(){
|
||||
assertEquals(3, JosephusProblem.findTheWinner(5,2));
|
||||
assertEquals(5, JosephusProblem.findTheWinner(6,4));
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user