Ad
  • Custom User Avatar

    I've figured it out: using iterators such as loop, each, etc. will give the max iteration error. However, using while true does not, presumably because it's lower level. This is slightly obscure though - I always use loop do..end over while true, because I feel like it's better at communicating what it does. Hopefully this comment helps others who are stumped by this one!

  • Custom User Avatar

    I'm quite confused by this. I know a couple of algorithms for calculating the size of linked list loops (none of which involve hashes or storing nodes), but they all require looping through the whole loop. However, that's impossible in this case, because the maximum number of loop iterations is limited to 5000, despite the fact that the kata gives us linked lists of much greater size.

    I don't see how it's possible to determine the size of a loop when we're not allowed to go through the entire thing! Am I missing something?