• 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
linov Avatar
Name:Unknown
Clan:Unknown
Member Since:May 2019
Last Seen:Dec 2020
Profiles:
    Following:1
    Followers:0
    Allies:0
    View Profile Badges
    Ad
    Educator, struggling to assess your students?
    Assess your classroom or bootcamp with the world leading assessment platform, Qualified.Request your demo today!
    • Stats
    • Kata
    • Collections
    • Kumite
    • Social
    • Discourse
    • Conversations (23)
    • Replies
    • Authored
    • Needs Resolution
    • Custom User Avatar
      • roseinapuddle
      • commented on "Positive to negative binary numbers" kata
      • 5 years ago

      Thanks for making this Kata!
      I found the instructions to "add one" a bit misleading for this example:

      [1,0,0,0]
      invert: [0,1,1,1] (= 7)
      add 1: [1,1,0,0,0] (= 8)

      Maybe include this example and say:

      [1,0,0,0]
      invert: [0,1,1,1] (= 7)
      add 1 treating the number as binary: [1,0,0,0] (= 8 in binary, = -8 in 2's complement).

      (I'm new to 2's complement, so maybe it's only confusing for people not familiar with it)

    • Custom User Avatar
      • Blind4Basics
      • commented on "Positive to negative binary numbers" kata
      • 5 years ago

      @FArekkusu: see the issue above, plz

    • Custom User Avatar
      • Blind4Basics
      • created an issue for "Positive to negative binary numbers" kata
      • 5 years ago

      this sentence in the description makes close to no sense according to the task:

      However, the arrays can have varying lengths, not just limited to 4.

      It should be replaced with something like (hopefully (edit: it does) this will match JS and C# too...?)

      The output array must have the same length than the input array

      and at least one fixed tests with a different length should be added (both to test cases and example tests parts)

    • Custom User Avatar
      • rowcased
      • commented on "Positive to negative binary numbers" kata
      • 5 years ago

      check the thread just below this

    • Custom User Avatar
      • webmisfit
      • commented on "Positive to negative binary numbers" kata
      • 5 years ago

      thank you @rowcased. Iam done. What was fixed?

    • Custom User Avatar
      • rowcased
      • commented on "Positive to negative binary numbers" kata
      • 5 years ago

      The reference solution has been fixed, so, refresh the page, reset the trainer and try again.

    • Custom User Avatar
      • visph
      • commented on "Positive to negative binary numbers" kata
      • 5 years ago

      Nice done, thank you @FArekkusu :) (even if this invalidate previous solutions ;P)

    • Custom User Avatar
      • FArekkusu
      • resolved an issue on "Positive to negative binary numbers" kata
      • 5 years ago

      Submitted my own solution. All works now.

    • Custom User Avatar
      • FArekkusu
      • commented on "Positive to negative binary numbers" kata
      • 5 years ago

      I have fixed the reference solution. Please, reset the trainer and try again.

    • Custom User Avatar
      • visph
      • commented on "Positive to negative binary numbers" kata
      • 5 years ago

      @stɛffan153: actually JS random tests produce input of length < 4 and expect result of length 4 :(

    • Custom User Avatar
      • visph
      • commented on "Positive to negative binary numbers" kata
      • 5 years ago

      I'm totally agree with you... that should be stated in the kata description and better if minimum length 4 is required, expected result of input such as [ 0, 1, 0 ] should be [ 1, 1, 1, 0 ] but not [ 0, 1, 1, 0 ] as it is actually ^^

    • Custom User Avatar
      • user8436785
      • commented on "Positive to negative binary numbers" kata
      • 5 years ago

      It doesn't need to be of length 4. It needs to be of whatever length that the array passed in was.

    • Custom User Avatar
      • user8436785
      • resolved a suggestion on "Positive to negative binary numbers" kata
      • 5 years ago
    • Custom User Avatar
      • webmisfit
      • commented on "Positive to negative binary numbers" kata
      • 5 years ago

      [0,0,1,0] = 2 in base 10

      [1,1,0,1] <- Flip the bits

      Add 1

      [1,1,1,0] = -2

      i dont understand this

    • Custom User Avatar
      • rowcased
      • commented on "Positive to negative binary numbers" kata
      • 5 years ago

      If you like, you can post your code with proper code markdown, (and don't forget to use the spoiler tag). I'll take a look and debug what I can/should for you.

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

    Confirm

    • Cancel
    • Confirm

    Collect: undefined

    Loading collection data...