• 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
mwbrown Avatar
Name:Michael Brown
Clan:Unknown
Member Since:Aug 2017
Last Seen:Jul 2024
Profiles:
Following:2
Followers:3
Allies:2
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (16)
  • Replies
  • Authored
  • Needs Resolution
  • Custom User Avatar
    • user8231842
    • commented on "Grasshopper - Summation" c solution
    • last month

    That's a clean solution to be honest

  • Custom User Avatar
    • mynameisV
    • commented on "Plus - minus - plus - plus - ... - Count" c solution
    • 5 months ago

    Can't get much better than this.
    Maybe casting to bool would be quicker than double negation?
    Or shift right for 31?

  • Custom User Avatar
    • xuiqzy
    • commented on "Sum of Pairs" rust solution
    • 8 months ago

    Wouldn't this fail (logic error) if s - y is less than -128 or greater than 127? Because sometimes the needed copmlement is not in the i8 range. So then the indexing would confuse it with another complement value that is inisde the i8 range. If so, it could be fixed by a simple bounds check on x and a continue if it is out of bounds.

  • Custom User Avatar
    • Chrono79
    • commented on "Count Odd Numbers below n" c solution
    • 4 years ago

    devagya, please use spoiler flag next time.

  • Custom User Avatar
    • mwbrown
    • commented on "Count Odd Numbers below n" c solution
    • 4 years ago

    It can be, but plenty of compilers will optimize a divide-by-two into a shift anyway. (Specifically any divide-by-power-of-two can be turned into a single shift)

  • Custom User Avatar
    • germes__89
    • commented on "Count Odd Numbers below n" c solution
    • 4 years ago

    Yes, bit operating is faster

  • Custom User Avatar
    • devagya
    • commented on "Count Odd Numbers below n" c solution
    • 4 years ago

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

  • Custom User Avatar
    • icyJoseph
    • commented on "Sum of Pairs" rust solution
    • 5 years ago

    Same :D

  • Custom User Avatar
    • DaniGuardiola
    • commented on "Cartesian neighbors" go solution
    • 6 years ago

    Given that the task is very specific I'd say it is, as it is performant and the code is readable.

    If you had to, for example, generate neighbors up to a variable distance n received as a parameter of the function, that would be a different story.

  • Custom User Avatar
    • rowcased
    • commented on "Plus - minus - plus - plus - ... - Count" kata
    • 7 years ago

    return the count

  • Custom User Avatar
    • john c
    • commented on "Plus - minus - plus - plus - ... - Count" kata
    • 7 years ago

    Do I have to return a table as the example shows?

  • Custom User Avatar
    • mwbrown
    • commented on "Plus - minus - plus - plus - ... - Count" kata
    • 7 years ago

    The usual wording in math problems like this would be "non-negative". The description could either make an exception for 0, or just change "positive" to "non-negative" and give a clear example.

  • Custom User Avatar
    • Voile
    • commented on "Plus - minus - plus - plus - ... - Count" kata
    • 7 years ago

    0 is neither positive or negative, so...

  • Custom User Avatar
    • Unnamed
    • commented on "Plus - minus - plus - plus - ... - Count" kata
    • 7 years ago

    0 just can't be positive in standard math, so it has to be reworded somehow instead.

  • Custom User Avatar
    • mwbrown
    • commented on "Plus - minus - plus - plus - ... - Count" kata
    • 7 years ago

    NASM Translation

  • Loading more items...
  • © 2025 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Code of Conduct
  • Contact

Confirm

  • Cancel
  • Confirm

Collect: undefined

Loading collection data...