Ad
  • Custom User Avatar

    The Node class is already defined and preloaded for you. You shouldn't need to define it yourself. Just use it as explained in the last part of the description.

  • Custom User Avatar

    Fixed it. Thanks!

  • Custom User Avatar

    I just mean having a test for a sufficiently large number, like 99999999999999 (not necessarily that one) so that a trivial solution like checking every number between 1 and that number would fail due to a timeout.
    That would make the kata more interesting because people would need to fund a more efficient way to check for primality.

  • Custom User Avatar

    Would be nice if some of the test cases provided an input large enough so that a straightforward implementation would timeout. Just to make the kata a little bit more interesting.

  • Custom User Avatar

    The initial code to implement reads "function Bus {...". Are the missing "()" intentional or just missing?

  • Custom User Avatar

    I missed a line on the test cases. Now only some solutions are invalid, which are probably missing some edge case

  • Custom User Avatar

    I have updated the test cases to add some radomness but that seemed to have invalidated all previous solutions (except mine :P).

    I'm checking to see if there's something wrong with the tests or with the solutions.

  • Custom User Avatar

    The test cases are pretty deterministic so if your solution doesn't pass there's probably some case you're not considering.

  • Custom User Avatar

    haha yeah... I would change the assertEquals to expect to avoid that but then that would be bad for people actually trying to get feedback when really trying to solve this...

    +1 for thinking outside the box though :)

  • Custom User Avatar

    When I try to create a new Kata, after filling up all the required fields and clicking on either Publish or Save nothing happens and I get a "Uncaught TypeError: Object # has no method 'exitFullScreen' " on Chrome console.

    Anyone else experiencing something similar?

  • Custom User Avatar

    Hi wthit56,
    what you are describing would be a double linked list, where each node keeps track of the previous and next node on the list.
    In a binary tree, each node has a reference to its left and right child but these child do not have a direct reference to their parent. So if 'a.getLeft()' gets you node 'b' then 'b.getRight()' will not get you 'a' back. It will get you whatever b's right child is or undefined if it has none.

    I'll try to update the description to clarify this. Thanks!