Solution to Count-Factors by codility

28 Jul


Question Name: Count-Factors or CountFactors

6 thoughts on “Solution to Count-Factors by codility

  1. Hi Sheng! Thanks for share your solutions!
    In this one, I disagree, cause if N=1 the result should be 1 and in this solution return 0.
    Just that!

    • I agree with your conclusion “if N=1 the result should be 1”, but disagree with “this solution return 0”. Actually this solution will return 1, if the input is 1. Please refer to the line #11.

  2. When I run the C# version of your solution through Codility it fails timing on the last LARGE Number test case. As a result I modified it so that the multiplication isn`t performed for each loop in the while.

  3. Java solution

Leave a Reply

Your email address will not be published. Required fields are marked *