Ad
  • Custom User Avatar

    I spent close to 2 weeks on this kata and produced a massively long solution which passed the initial test cases but was too inefficient for submission. It was heartbreaking but I knew that was going to happen.
    I feel ur pain bro

    PS: I converted my solution into a calculator app so it wasn't a waste of time in the end! On my github

  • Custom User Avatar

    Hi, thank you for making your solution easy to follow. I still struggle with recursive solutions tho.
    I understand how you are recursively calling decompose until the difference between n2 & i2 == 0, but how does it work when the results are concated into the array after? I tried following the steps on python tutor but I still didnt fully understand it.
    Thanks.

  • Custom User Avatar

    Please use code blocks when pasting code.

  • Default User Avatar

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

  • Custom User Avatar

    THANK YOU SO MUCH. I'VE BEEN STUCK ON THIS FOR LIKE 2 WEEKS NOW.
    I can't tell you how grateful I am for your help @ӜЯℱӁℒᚹ

  • Custom User Avatar

    I think that makes sense. I will try and get back to you. Thank you for responding!

  • Custom User Avatar

    Uncomment that code, and add a condition that when lst.length == 0, return []

    Because:

    Math.max(...[]) = -Infinity
    Math.min(...[]) =  Infinity
    

    (And these were causing your code to time out)

    Got it?

  • Custom User Avatar

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

  • Custom User Avatar

    You are a true friend.

  • Custom User Avatar

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

  • Custom User Avatar

    Java Challenge:
    Why is value for length of array included in arguments?
    What is *z?
    Why is this different than the Python/Javascript problems?

  • Custom User Avatar

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

  • Custom User Avatar

    @Chrono79 Thank you for your help!
    I worked through the javascripttutor and recognized where it went wrong.
    All I had to do was decrement i after removing the element so that I wasn't skipping the next element in the array (since all following elements in the array would shift left).

  • Custom User Avatar

    LMAO I didn't call the function before so it wasn't executing the code.
    Now its working :)

  • Custom User Avatar

    Call your function like this: arrayDiff([1,2,2], [2]) and see what happens. When you mutate the first array that you're using in the loop, your code skip some values.

  • Loading more items...