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.
;)
its been 5 yrs since you completed this, hopefully you kept going and now are a very well paid programmer or something like that.
before solving question give a good amount of time on understanding how the code works you will get better hope it helps
This was the easiest 7 kyu challenge i've come across so far.
It was suspiciously easy.
I feel so dumb that this took me so long to figure out such a simple solution.
I even bookmarked it and came back several times the past 2 weeks. 🤦♂️
use chatgpt as an aid. If you don't know how to do the 8kyus you lack the fundamentals of the language. It is fine, just take the L and look at the solutions. Learn from them and work out what they mean. If you can't figure it out after 5/10 minutes just look at the answer. Using chatgpt you can say what does {insert code} mean in python/js/c++ {insert language} and it will break everything down for you. A brilliant learning resource. glhf
Yes, quite obvious.
Used to use it while debugging without a second thought.
Thx a lot!
console.log()
is a function like any other, it's just code.null.length
as an argument to it will still be evaluated like any other part of your code, because it's part of your program. It will crash (it should be obvious why). Just becuaseconsole.log
is a function that prints stuff to the console doesn't mean that invalid code in it will be ignored, somehow. Code is code. Every line in your function is part of your code, and it all has to work at runtime.Hi there,
Can some of you explain me why
console.log(input.length),
added while debugging the solution, gives a TypeError: cannot read properties of null
in test case of NULL (i.e. null.length => aforementioned TypeError) and prevents me from completing the kata?
I used to think that console.log(whatever happens inside it) has no effect on the overall outcome of the program apart from throwing some alert on the screen.
Took me 2 hours to solve this and alot of googling, if this is only a 8 Kyu problem then I should rethink my life and maybe restart my Python learning from the basics.
This comment is hidden because it contains spoiler information about the solution