Ad
  • Custom User Avatar

    @John%20Newman .. Well .. Thanks for Replying Bro :blush: :blush: .. I'm Tuned to Approve the new Translation .. Regards .. Zizou

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    I'm sorry I made an off-by-one error :( I'll update the kata.

  • Custom User Avatar
  • Custom User Avatar

    Yep, you are correct i've tried to solve this kata in Scala. Thanks for you quickly answer, a kind regard ;)

  • Custom User Avatar

    @ivitojv ,, Well ..

    • Thanks Bro for pointing out :blush: :blush:..
    • You've Tried solving this kata in Scala , Haven't You ?? :wink: :wink:
    • It's the most recent translation of this kata just 2 hours ago , and when I've tried solving using my solution in C++, yeah the result was (11) , because all the previous prime numbers addition will clearly lead to non-prome sum , So I'll mention the Scala Translator to do the Necessary :point_up_2::point_up_2:
    • Also i'll keep the the issue unresolved till modifications take place .. :+1: :+1:
    • Happy to be the First to follow you Bro .. hope you the best .. Regards ,, Zizou :relaxed: :relaxed:
  • Custom User Avatar

    This test failed:
    Feature: The TransformToPrime object can compute the smallest number needed to convert the sum of a list of integers to a prime number Scenario: Computing minimumNumber824,106,198,358,349,276,434,425,752,190,491,376,573,884) should result in 5

    That sequence of numbers sums 6236 plus 5 = 6241 and that number is not prime. Its 79x79. The correct answer is 11.

  • Custom User Avatar

    thanks for the advices! Im a begginer on this language and its always good to learn new ways to do the same

  • Default User Avatar

    You can replace

    (1 until number).map(_.toLong)
    with
    (1L until number)

    Scala will infer that the range should be of type long by the type of the start of the range. I'm pretty certain that this should be more efficient as it should just create the range once as the correct type, rather than create one Int range, and then one Long range.

    You could also change
    if(a%3==0||a%5==0)true else false
    to
    (a%3==0||a%5==0)
    Both do the same job, but the second is clearer and should be more efficient because it doesn't need to use a bool to look up a bool.