• Sign Up
    Time to claim your honor
  • Training
  • Practice
    Complete challenging Kata to earn honor and ranks. Re-train to hone technique
  • Freestyle Sparring
    Take turns remixing and refactoring others code through Kumite
  • Community
  • Leaderboards
    Achieve honor and move up the global leaderboards
  • Chat
    Join our Discord server and chat with your fellow code warriors
  • Discussions
    View our Github Discussions board to discuss general Codewars topics
  • About
  • Docs
    Learn about all of the different aspects of Codewars
  • Blog
    Read the latest news from Codewars and the community
  • Log In
  • Sign Up
isqua Avatar
Name:isqua
Clan:Yandex
Member Since:Aug 2015
Last Seen:Aug 2024
Profiles:
Following:154
Followers:583
Allies:143
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations
  • Replies (14)
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • ejini战神
    • resolved a suggestion on "Decode the Morse code, advanced" kata
    • 4 years ago
  • Custom User Avatar
    • thanhkhanhcntt
    • commented on "Can you get the loop ?" javascript solution
    • 5 years ago

    This is BAD solution

  • Custom User Avatar
    • Grey
    • commented on "Can you get the loop ?" javascript solution
    • 5 years ago

    DSPACE(n) is a superset of DTIME(n) [1]. This means at best your algorithm matches the time complexity of this one. But this rule also applies to the case where n is known ahead of time and the data structure can be allocated all at once (best-case scenario). So your algorithm is almost guaranteed to be asymptotically worse than O(n).

    Or in layman's terms: Allocating space takes time. Allocating n memory cells generally takes at least n units of time. In a scenario where you don't know the value of n (such as this) you have no choice but to grow your data structure gradually. Once you've used up all the currently allocated space, you need to allocate a bigger space somewhere else and copy the values over. And so on.

  • Custom User Avatar
    • user8436785
    • resolved a suggestion on "Decode the Morse code " kata
    • 6 years ago
  • Custom User Avatar
    • jdsteinhauser
    • commented on ""Find the unique number" Elixir Translation"
    • 6 years ago

    Will do! I should have one together fairly shortly.

  • Custom User Avatar
    • hksong
    • commented on "Can you get the loop ?" javascript solution
    • 7 years ago

    Difficult to say if it is better. You are going to be recalculating collisions as you dynamically create the map while checking at every iteration. What's worse is that if all your buckets are full, it will have to redistribute the entire map after making more buckets.

    You can also use has instead of comparing the get.

    And given this is JS, ECMA only requires the algorithm to be sub-linear on average, not constant.

    So even just time complexity-wise, you would need to do a real performance test to claim that one way is better than the other. And of course, this solution has much better space complexity than yours.

  • Custom User Avatar
    • Bodigrim
    • commented on "Last digit of a huge number" kata
    • 8 years ago

    Reference solution is incorrect, as pointed out by @konakona above:

    Expect(LastDigit( []int{2,2,101,2}            )).To(Equal(6))
    
  • Custom User Avatar
    • Voile
    • resolved a suggestion on "Last digit of a huge number" kata
    • 8 years ago

    It's been approved

  • Custom User Avatar
    • jolaf
    • commented on "Decode the Morse code " kata
    • 8 years ago

    Approved! Thank you for the translation!

  • Custom User Avatar
    • jolaf
    • commented on "Decode the Morse code, advanced" kata
    • 8 years ago

    Approved! Thank you for the translation!

  • Custom User Avatar
    • GiacomoSorbi
    • commented on ""Do you know how to make Query String?" Crystal Translation"
    • 8 years ago

    I still do not see the point, as you are going to compare the users' solutions with your own code: rounding it up with a function just makes things more clean and readable.

  • Custom User Avatar
    • GiacomoSorbi
    • commented on ""Do you know how to make Query String?" Crystal Translation"
    • 8 years ago

    No, I will not, as basically 99% of the katas here are done like that and there is a reason for it: we want to verify the user solution against a template :)

  • Custom User Avatar
    • jolaf
    • commented on "Decode the Morse code, advanced" kata
    • 9 years ago

    Oh, I see your point.

    I've added the test case you suggested to the original Python version of this kata.

    However, the JavaScript translation is broken in this matter, so I've added the test case but had to comment it out.
    Unfortunately I'm not as good in JavaScript to fix the translation code. :(

    But thanks for your kind contribution anyway!

  • Custom User Avatar
    • jolaf
    • commented on "Decode the Morse code, advanced" kata
    • 9 years ago

    In which aspect do you think this test is better than the others already present in the kata?

  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...