Ad
  • Custom User Avatar

    wow, very nice, another option that I learn from you!!

  • Custom User Avatar
  • Custom User Avatar

    CoffeeScript: Missing random tests

  • Custom User Avatar
  • Custom User Avatar

    Fixed.

  • Custom User Avatar

    sorry for my importunity, but there's a typo here:
    "but depending on seleced method"
    -> selected method

  • Custom User Avatar
  • Custom User Avatar

    added + chai assertions

  • Custom User Avatar
  • Custom User Avatar

    Your solution is almost good, but has a bug, and becomes inaccurate at some point. See following:

    Here is row 57 (yours vs expected), which is correct:

    Yours:    1, 56, 1540, 27720, 367290, 3819816, 32468436, 231917400, 1420494075, 7575968400, 35607051480, 148902215280, 558383307300, 1889912732400, 5804731963800, 16253249498640, 41648951840265, 97997533741800, 212327989773900, 424655979547800, 785613562163430, 1346766106565880, 2142582442263900, 3167295784216200, 4355031703297275, 5574440580220512, 6646448384109072, 7384942649010080, 7648690600760440, 7384942649010080, [...]
    Expected: 1, 56, 1540, 27720, 367290, 3819816, 32468436, 231917400, 1420494075, 7575968400, 35607051480, 148902215280, 558383307300, 1889912732400, 5804731963800, 16253249498640, 41648951840265, 97997533741800, 212327989773900, 424655979547800, 785613562163430, 1346766106565880, 2142582442263900, 3167295784216200, 4355031703297275, 5574440580220512, 6646448384109072, 7384942649010080, 7648690600760440, 7384942649010080, [...]
    

    Here is row 58 (yours vs expected), which starts getting inaccurate:

    Yours:    1, 57, 1596, 29260, 395010, 4187106, 36288252, 264385836, 1652411475, 8996462475, 43183019880, 184509266760, 707285522580, 2448296039700, 7694644696200, 22057981462440, 57902201338905, 139646485582065, 310325523515700, 636983969321700, 1210269541711230, 2132379668729310, 3489348548829780, 5309878226480100, 7522327487513475, 9929472283517788, 12220888964329584, 14031391033119152, 15033633249770520, 15033633249770520, 14031391033119152, [...]
    Expected: 1, 57, 1596, 29260, 395010, 4187106, 36288252, 264385836, 1652411475, 8996462475, 43183019880, 184509266760, 707285522580, 2448296039700, 7694644696200, 22057981462440, 57902201338905, 139646485582065, 310325523515700, 636983969321700, 1210269541711230, 2132379668729310, 3489348548829780, 5309878226480100, 7522327487513475, 9929472283517787, 12220888964329584, 14031391033119152, 15033633249770520, 15033633249770520, 14031391033119152, [...]
    

    See how your solutions gets 9929472283517788 vs 9929472283517787 incorrectly at row 58. Similarly, all rows beyond 58 contain more and more incorrect numbers. You need to fix a bug in your solution (a very small one!)

  • Custom User Avatar

    What to do if I have reached max buffer size? I have no idea how to solve this in a different way.

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar

    it's so easy for me. I'm very happy to improve my logic in javascript with codewars

  • Custom User Avatar

    This kata requires no optimization whatsoever.

    Read about properties of prime numbers, filter the possible divisors and their upper-bounds instead of doing an exponential-complexity computation.

  • Loading more items...