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.
Why is the exercise worded like a question from stackoverflow?
@JJar could you please reply with your code? It doesn't display properly when I click on view solution to your comment.
@howard@mmpix.com but it is the same thing given that he uses the j variable as the index for the second array (sumv) and so the columns get updated correspondingly? Anyway, you're way of doing it is cool and makes more sense in terms of how humans think.
I was referring to the redundancy of declaring an additional variable and I am right regardless of the low-level implementation. However, we shouldn't throw words around, so please, enlighten me how declaring a variable and assigning it an object doesn't use memory allocation :D
You say I make bogus claims but I don't see you bringing any arguments to the table, so I'm going to categorize your unfounded claim to also be a "bogus claim" :D
I was just addressing one property of "best practice" code because it's only that property that that code blatantly violates. Naturally, I wouldn't have brought it up if the trully efficient solution was a hard-to-write hard-to-understand mess, but it's not the case (6 kyu problem, get real). It's nice that you talk about real life code, and I fully agree, it depends on the context. However, if you pay attention, there is only one "best practices" button, there's no "best practices for (insert git repo)", so we're talking generally, and generally, efficiency matters (as I said before, the efficient method is not hard to understand and or write). The link is for beginners, and I myself looked up stuff about javascript low-level implementation because I'm not experienced with this language and I don't want to talk without knowledge.
"It's not like anyone has problems seeing the time complexity there"
(by you)That's an arrogant thing to say. Not everyone learned programming from university + a lot of people start with web programming which doesn't really involve complexity talk (not at a beginner level at least).
It's obvious that you don't like me, but please, be more friendly next time, not for me, but for those reading, they shouldn't be subjected to this toxic comment of yours.
Look, I personally think you are a competent programmer, but what I don't like about you is that you are dumb as a person. Your whole premise is flawed, because you don't understand the context (read my first paragraph if you're confused). You only care about being right, not about learning new things, that's why you don't give me or anyone else the benefit of the doubt.
I'm done here, if you got something more to say to me directly don't exert yourself, I won't read it (just cry to a friend about it or something I don't care).
I see this solution has the most "best practices" votes. For any beginners reading, this is not a best practice solution. Best practice code means code that you would feel comfortable using in production environment which means the code should be efficient. This code runs in roughly n * 2k time (each slice() call takes k time and each join() call takes k time) which isn't the most efficient for the problem at hand.
Here's a beginner level short article I found for getting started with understanding time complexity in javascript : https://www.pdiniz.com/time-complexity-of-javascripts-built-in-methods/
You're not missing anything, he allocates an additional variable for nothing.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
For some reason I can't view your solution anymore. "This comment has been hidden" :( (from what I remember, your solution was correct besides that small mistake that you corrected so I don't know why it doesn't pass).
This kata is very, very similar to "IQ Test" kata (6 kyu). Is there a way of deleting "IQ Test" (because it has less people that solved it) without people losing honor points?
This kata is very, very similar to "Find The Parity Outlier" kata. Is there a way of leaving only one of them and to delete the other without people losing honor points?
Thanks for the response!
Ok, but, out of curiosity, what is the threshold number of solutions submitted after which you can't change the kata anymore? Is it 500? I was looking up this stuff but the info is so
fragmented, can't really be sure. And since you have so much honor points, I think you should have the privilege to adding test cases without invalidating others' solutions. Why is this not
the case?
My solution worked and it shouldn't have so that's an issue in my book. Just because I worded it in the most non-arrogant way possible, doesn't mean it's not meant as an issue.
Thanks for the response!
Ok, but, out of curiosity, what is the threshold number of solutions submitted after which you can't change the kata anymore? Is it 500? I was looking up this stuff but the info is so
fragmented, can't really be sure. And since you have so much honor points, I think you should have the privilege to adding test cases without invalidating others' solutions. Why is this not
the case?
My solution worked and it shouldn't have so that's an issue in my book. Just because I worded it in the most non-arrogant way possible, doesn't mean it's not meant as an issue.
This comment is hidden because it contains spoiler information about the solution
Loading more items...