Ad
  • Default User Avatar

    There seems to be an issue here. My code fails the example test, but passes the 40 random tests. Tried in Python 3.11 and 3.10.

  • Custom User Avatar

    Would you mind posting your code here (and marking it as a spoiler)? That way, I can potentially identify and locate the problem, cheers :)

  • Default User Avatar

    I am pretty new to this. Working in JS.

    I read about singly linked lists and tried to return some of the attributes, like length, head, node but I'm always getting "undefined" or an error. I would like to understand SLL, but whenever I use anything I read in the tutorials, I am basically hitting a brick wall here. Any tips? (I read the Wikipedia link and a few others)

  • Custom User Avatar

    Great work! You may want to explore a feature called regular expressions to understand other people's solutions for this kata.

  • Default User Avatar

    I think I understand :) Thanks!

  • Custom User Avatar
  • Custom User Avatar

    Being able to throw an Error (once again, an Error, not a string) is important because if, for example, you receive a wrong type of input you want to clearly identify that the input was wrong and that your code is not supposed to work with this input. Imagine you were asked to input your name and instead typed up some numbers: you would expect an alert message telling you that you did something wrong. That is why it is a better practice to program error throwing instead of accepting wrong inputs.

  • Default User Avatar

    Sorry, I don't think I understand. I did understand that I should use "throw" instead of "return" and I tried using strings, numbers, true/false, but I always get "No/wrong exception message...
    Value is not what was expected". Note that I have just found out about throw and that I don't yet have a clear picturea as to why do we really need it :)

  • Custom User Avatar

    Make sure you are throwing an Error, not a string. See the link below in answer to james1968.

  • Default User Avatar

    Run Test : All good. Expected error was thrown.
    Attempt : No error message.
    Wth?