Skip to content

CentralArkansasCodeKata/PrimeFactors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Prime Factors

Using test driven development (TDD) write a prime factor generator method and at least 7 unit tests to go along with it. You are more than welcome to write more unit tests if you prefer.

###Task Write a method that will take an integer parameter and return a collection of integers. The method should return the prime factors for the input parameter. You can write the answer in whatever language you prefer so the collection of integers can be whatever is used to represent a list of integers in the language you choose to use to solve the problem. For bonus points see how few lines of code you can write it in and still have a valid solution without using any framework or built-in methods besides basic math methods (i.e. add, subtract, multiply, divide, and modulus).

###Input Create at least 7 unit tests with these test input parameters:

  • 1
  • 2
  • 3
  • 4
  • 6
  • 8
  • 9

###Output The answers to the above inputs are listed below in the same order:

  • emtpy list
  • 2
  • 3
  • 2, 2
  • 2, 3
  • 2, 2, 2
  • 3, 3

###Reference Thanks to uncle bob's website for this Code Kata. He has some great katas on his website and I'm sure we'll use some more of them as we continue to code kata.

Answer Submission Instructions

  1. Fork this github repository.
  2. Write your solution to the problem.
  3. Commit your solution to the repository.
  4. Post a link to your fork as a comment to this Prime Factors post on codekata.co.

Releases

No releases published

Packages

No packages published