Ad
  • Default User Avatar

    Hi,

    Thanks for your response.

    The behavior you describe is intentional. The way I figure it, enqueue will be the more frequent operation and should be faster. At the very least, the cases are equal. If every object that gets enqueued is subsequently dequeued, it doesn't matter whether the performance hit is on enqueue or dequeue. But if there are some enqueued objects that don't get dequeued before the list is destroyed, my implementation saves n - 1 traversals, where n is the number of elements in the queue when it's destroyed (there is still one traversal required to destroy the remaining elements).

    I believe my implementation is defensible and shouldn't be penalized. I can change it around to pass the kata, but I believe this is a bug in the way the kata is graded.

  • Default User Avatar

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

  • Default User Avatar

    I keep timing out. My implementation is a pretty standard queue implementation, so I think the tests are too aggressive.

  • Default User Avatar

    I agree. The description is just wrong.

    "If the value passed in is a string containing numbers or other characters other than spaces and alphabet letters, return 'Not letters'"

    but

    Testing for 1jh2o
    It should work for random inputs too - Expected: "1", instead got: "Not letters"

  • Default User Avatar
  • Default User Avatar

    Ah, cool, thanks for the clarification!

  • Default User Avatar

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