Ad
  • Custom User Avatar

    "First" and "longest" are superlatives that do not necessarily reflect the same element in a sequence.

    After some consideration, I believe the confusion arises from a very common unawareness of how a superlative can apply to more than one element. However, to more easily interpret it this way, there has to be a plural somewhere.

    For that reason, "first longest string" is easily (mis)interpreted to mean "the first string longer than any preencountered string", because there is no hint of plurality.

    Hence, I think the criteria "first" and "longest" are confusing and in need of qualifiers, i.e. "first string among those that are the longest length", which is much harder to misinterpret.

  • Custom User Avatar

    The code that is output if one prints it seems to differ from what code is actually being run, or there's an issue with copy/paste. I've tried copying into external editors only to find whitespaces missing. I believe that copying directly (at least on my system/browser) omits leading whitespace on lines, so I had to manually count the number of spaces and insert them.

    Another possible cause of infinite looping (check the stack contents) is the order of operands in the non-commutative binary operators. If - is carried out as a-b the result is an infinite series of -7,8... accumulating in the stack. I ran into this and found out only after looking at the stack and my interpreter passed the test once I fixed this detail.

  • Custom User Avatar

    I almost finished this the day I worked on it, had to call it quits for the day, came back the next day, finished my solution, pasted it in. It passed visible tests (and the submission tests) but then encountered an error when I tried to submit final. Now all I get when I submit is a message that the solution is withheld because "you have not solved this kata yet."

    What's going on here?

  • Custom User Avatar

    490 cakes? (Actual number encountered during random tests)

    We'd both die of overeating.

    This is definitely a challenging problem that requires above-average skill in algorithm design, if the solution is required to scale like this and still run all tests in under 6 seconds.

    I thought I had a decent solution that scaled a lot better than O(2^N) (my first working solution before improvements) until it hit random testing and all hell broke loose.