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.
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
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.
Please use code blocks when pasting code.
This comment is hidden because it contains spoiler information about the solution
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 @ӜЯℱӁℒᚹ
I think that makes sense. I will try and get back to you. Thank you for responding!
Uncomment that code, and add a condition that when
lst.length == 0
, return[]
Because:
(And these were causing your code to time out)
Got it?
This comment is hidden because it contains spoiler information about the solution
You are a true friend.
This comment is hidden because it contains spoiler information about the solution
Java Challenge:
Why is value for length of array included in arguments?
What is *z?
Why is this different than the Python/Javascript problems?
This comment is hidden because it contains spoiler information about the solution
@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).
LMAO I didn't call the function before so it wasn't executing the code.
Now its working :)
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...