• Sign Up
  • Kata
  • Kumite
  • Forum
  • Wiki
  • Leaders
  • Log In
  • Sign Up
Name:Niklas Engblom
Clan:Happit
Member Since:Apr 2015
Last Seen:Apr 2019
Profiles:
Following:10
Followers:7
Allies:7
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (58)
  • Replies
  • Authored
  • Needs Resolution
    • senseilein
    • commented on "Return Negative" javascript solution

    Hi, I believe the solution covers case 0, normally -Math.abs(0) should return 0.

    • -?-
    • commented on "Return Negative" javascript solution

    smart but what about case 0 ?...it wont work for 0 value..but you passed..how?

    • melivaro
    • commented on "Return Negative" javascript solution

    Best practices!

    • BlueNeedle
    • commented on "Return Negative" javascript solution

    Smart, but doesn't check for the case that num is equal to 0. Instructions requested that step. But js is our master so if it accepts this solution then no prob.

    • Florencia Ezcurra
    • commented on "Return Negative" javascript solution

    This is very eloquent. Thank you for helping us think outside the box.

    • FArekkusu
    • created an issue for "Needles in a haystack" kata

    No random tests.

    • cobailey8
    • commented on "Return Negative" javascript solution

    I solved it this way, knowing that it was probs going to be the top solution (since the top answer is typically the most clever/clean answer, not always the most efficient). That being said, I've never flip-flopped my oppinion about my answer so many times while reading a discorse on codewars before... lol. It's 8kyu and we're all overthinking the crap out of it.

    • B1ts
    • created a suggestion for "Simple Blackjack" kata

    deck class should start with capital letter.

    for simplicity the value should be decided when the ace is dealt

    If anything, it makes it harder to calculate score this way. I suggest adding score recalculation on every draw.

    you should deal one card to the dealer's hand and keep one elsewhere

    This line makes sense in practise, but not for this kata. It's not tested anywhere and there's no reason to do this. The line should be removed altogether, imo.

    • SteveArray
    • commented on "Return Negative" javascript solution

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

    • Deantwo
    • commented on "Return Negative" javascript solution

    I would say this is best practice since it is easier to read and understand.

    The if solution is more likely to be written wrong or get misunderstood.

    • Deantwo
    • commented on "Return Negative" javascript solution

    The note about -0 that used to be in the kata description was written only with C# in mind. I reworded the note to make it sound less like a requirement last year.

    • tidusia
    • commented on "Return Negative" javascript solution

    Yes, you must be right. Thanks for your feedback.

    • Unihedron
    • commented on "Return Negative" javascript solution

    You've spent more time writing that than we've thought about the problem.

    Performance is a mechanic to consider for your task, and in this context when our goal is to solve a self contained problem with implied constraints, if it's fast enough to pass the test cases, it's the best practice.

    You can argue about O(1) vs O(2) all you want, but quite honestly it's javascript we're talking about here and the engine is better at running fast code than you are at writing fast code. Go use C++ or something.

    • kabuk1
    • commented on "Return Negative" javascript solution

    I tried this but it wasn't accepted. I tried a couple others that seem to be in here, but they also weren't accepted. I kept failing at least 1 test: 0 return undefined instead of 0.

    • zaineb
    • commented on "Return Negative" javascript solution

    so clever

  • Loading more items...
  • © 2021 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Contact
  • powered by

Confirm

  • Cancel
  • Confirm