• it's not, since in the linked kata there is always a loop

  • JavaScript translation kumited; please review and approve :)

  • I would agree that it is different. This one is easier and focuses on the core cycle detection algorithms without any additional requirements, such as in that kata. The goal of this kata is to detemine if there is a cycle, while that kata's goal is to detemine the length of the cycle.

  • Voile addressed this on GitHub a couple years ago:

    You can usually implement such requirement by doing stress tests using lots of tests/tests with huge sizes.
    If your solution is too bad in complexity then it timeouts :) And if it uses too much memory, it uses up all the memory and halts, so that's also a timeout.

    • You can scan the user's source file for keywords (/home/codewarrior/solution.txt)
    • You can include some macros in the preloaded section to "mess" with the user's code. I'll let you figure out the details. ;-)
    • If you can figure out the runtime environment's stack and heap size, you could try gobbling them up prior to calling the user's function? O_o That seems nasty, though. Haven't tried it myself. Let me know if you walk away unsinged. ;-D
  • I was worried about that. Is there a way to limit use of the standard library in a way accepted by the community? I feel like this problem is trivial if you are allowed to use a hash table or vector, but becomes much much harder and a more useful exercise when you have to use pointers. Thanks for the information though!

  • Thank you for the explanation. I will concede that your points are quite valid as even when I was writing up the solution for this I made a list of pointer variables and forgot to put an astrik in front of the later variables. I think it would be helpful to maybe define a styling to use in Kata's across the whole website though, so that in the future styling is more cut and dry.

  • Either Node* head or Node *head has some kind of meaning

    I respectfully disagree. IMHO Node* head (placing the pointer marking right next to the type) is inherently misleading because it suggests that one can do something like Node* a, b, c to define three pointers to Node but that is clearly not the case (well, perhaps except for C#, but who uses C# for low-level facilities?). But eh, as long as the compiler understands it :p TBH I've checked out the course contents in some of the intro C++ courses offered at my Uni and they use Node * head (which IMHO is weird because it looks like you're doing a multiplication :p).

  • Currently "using O(1) space" is not enforced, and wouldn't know how.

  • Actually they are a little bit different. The one you linked guarantees a loop exists and the goal is to find the length of the loop. The problem I have created asks you to determine if there is a loop or not. I am kind of new to the site though, is this not sufficiently different?

  • Unpublishing it I think.

  • You can unpublished the kata ;-)

  • I feel like it is clear. I read it like its another word in the type similar to "unsigned int" or something similar. Is there a styling guide anywhere on the website?

  • Thank you! Is there a way to close this?

  • Loading more items...