Ad
  • Default User Avatar
  • Default User Avatar

    its been 5 yrs since you completed this, hopefully you kept going and now are a very well paid programmer or something like that.

  • Default User Avatar

    before solving question give a good amount of time on understanding how the code works you will get better hope it helps

  • Default User Avatar

    This was the easiest 7 kyu challenge i've come across so far.

    It was suspiciously easy.

  • Default User Avatar

    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. 🤦‍♂️

  • Custom User Avatar

    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

  • Custom User Avatar

    Yes, quite obvious.
    Used to use it while debugging without a second thought.
    Thx a lot!

  • Custom User Avatar

    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 becuase console.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.

  • Custom User Avatar

    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.

  • Default User Avatar

    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.

  • Default User Avatar

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