Skip to content

csarmiento/test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Counting out problem

Code implementation that solves the counting out problem. In these problems, you are in a circle. From some starting point, X you count k people.

If you are standing in that kth spot, you are ‘out’. The counting continues until there is one person standing.

A concrete, but morbid, example of this is the Josephus Problem.

Running the program

The program will take in 2 parameters: the number of people in the circle (n) and the step rate (k).

  1. Clone the repo. You can put it anywhere you like.
git clone [email protected]:csarmiento/test.git
cd test
  1. Run the program, passing the 2 numbers: N and K.
sbt "run N K"

Interesting Reading

This article has a very interesting approach to tackle this problem: The Josephus Problem

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages