Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.
Would you mind posting your code here (and marking it as a spoiler)? That way, I can potentially identify and locate the problem, cheers :)
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)
Great work! You may want to explore a feature called regular expressions to understand other people's solutions for this kata.
I think I understand :) Thanks!
https://stackoverflow.com/questions/11502052/throwing-strings-instead-of-errors
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.
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 :)
Make sure you are throwing an Error, not a string. See the link below in answer to james1968.
Run Test : All good. Expected error was thrown.
Attempt : No error message.
Wth?