Ad
  • Default User Avatar

    Yes problem with between/3...

  • Custom User Avatar

    Try it ;-) It was just the first dirty fix I thought of. But you'll need to add the compound test back in to see the effect.

  • Default User Avatar

    OK. I looked at your solution; why have you thought to eval a compound? You could have directly begun with: prime_factors_(N, 2, "", R)..

  • Default User Avatar

    Given a positive number n

    17*17*93*677 is a positive number = 18195729:-)
    I don't know how your function works but I don't see any problem with that... nevertheless I replaced it by its value: 18195729.

  • Custom User Avatar

    Given a positive number n

    Because it doesn't make sense. A number != a compound, and some functions don't accept compounds. It would be similar if you passed in a string and didn't mention it could happen. IDK how valid it is to mix compounds and numbers in Prolog, but I would take a wild guess that it isn't. As you can see here(at the bottom), these are 2 different types.

  • Default User Avatar

    It is a product... Why is it a problem for you? Others passed fine this part.

  • Custom User Avatar

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

  • Default User Avatar
  • Custom User Avatar

    But you only see a few test cases. When you submit, there's probably hundreds of these tests run. So, is it really fast enough? :P

  • Default User Avatar

    I have tried all the test cases in my python shell and it's working fast.I don't get it what is making my code slow here

  • Custom User Avatar

    There was an issue while submitting your solution

    It could simply mean that CodeWars itself that was having problems. You should simply resubmit a few times, or copy your solution and refresh, try again. You should've received points for solving it, even if you didn't submit it.

  • Default User Avatar

    I tried your solution and what I get is:

    STDERR
    Execution Timed Out (12000 ms)
    

    Your code is too slow.

  • Default User Avatar

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