Ad
  • Default User Avatar

    This seems abnormally hard for a 5. 5 seems like a good rating for a straightforward, no frills, BFS problem. This is not that.

  • Default User Avatar

    "Doublets" is a problem where, given a dictionary and start & target words, you want to find the shortest way of modifying the start word letter-by-letter until it matches the target. Each modified word has to be in the dictionary. See https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=31&page=show_problem&problem=1091

    This is basically equivalent to this problem, with prime-testing replaced by dictionary look-up. Would it be worth creating this version as a kata, or would it be regarded as a duplicate?

  • Default User Avatar

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

  • Default User Avatar

    The description of the performance requirements are mainly there to let the user know how many tests they are going to need to face, as previouly requested by @dfhwze. It might be a bit too much to create a full section for it, so I have now changed it up a bit to include the number of tests in the intro instead :D

  • Default User Avatar

    I see, I'll keep this in mind.

  • Default User Avatar

    The is_prime function came first, but later on I got to use @mauro-1's solution which involved gmpy2.is_prime. I had simply forgot to remove the regular function, thanks for noting that :D

  • Custom User Avatar

    Why are you using a custom is_prime function on top of importing gmpy2.is_prime in the verification code?

  • Default User Avatar

    Sorrryyy, I'll fix it right away xD

    Should be fixed now :D

  • Default User Avatar

    I would like to translate this Kata to C++ but, the list of the primes in the tests hurts my eyes lol

  • Default User Avatar

    Thank you for your support! I hope this Kata will be translated too :D

  • Custom User Avatar

    Cool kata!
    I liked the combination of different topics (Graph theory and Number Theory).
    The description makes it funny, although as a non-native English speaker, I had to slow down a bit while reading, as I'm not that familiar with Old English (I've seen a bit of it before, though). It was a nice detail, anyway.

    Will be cool to see translations to other programming languages over time.

  • Custom User Avatar

    Hi again! (should be my last message)

    This is a minor issue, but your long list of primes (in the tests) is breaking code mirror syntax highlightening, which makes the code of the tests a pain to read. Could you:

    • either remove the damn list and generate the values from your functions (you aldready everything that is needed for this in there!)
    • or split the declaration over several lines so that the coloring still works?

    Thx

  • Custom User Avatar

    Side notes, for your next kata:

    • try to avoid using globals like you did here in the tests (fail).
    • try to not print stuff to the console (talkinga bout the very last message): in the mind of most active users, when something unusual pops up in the output panel, it means there is a problem (or that you're doing one of myjinxin2015 kata... :thonking: ), so the psychological effect of your message is a bit weird. Sort of...

    Cheers

  • Custom User Avatar

    Hi,

    You should remove the notes in the description about performances : none are actually involved (I see lots of suboptimal solutions rebuilding constantly the possible paths or using O(N) operations where constant time is possible).

    Cheers

  • Default User Avatar

    Thanks for the suggestions, I've added some new tags! :D

  • Loading more items...