Ad
  • Custom User Avatar

    Why is the exercise worded like a question from stackoverflow?

  • Custom User Avatar

    @JJar could you please reply with your code? It doesn't display properly when I click on view solution to your comment.

  • Custom User Avatar

    @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.

  • Custom User Avatar

    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

  • Custom User Avatar

    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).

  • Custom User Avatar

    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/

  • Custom User Avatar

    You're not missing anything, he allocates an additional variable for nothing.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    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).

  • Custom User Avatar

    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?

  • Custom User Avatar

    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?

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

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

  • Loading more items...