7 kyu

Shared Bit Counter

259 of 2,353Anarki
Description
Loading description...
Fundamentals
Binary
Bits
View
AllIssues6Questions2Suggestions8Show Resolved
  • Please sign in or sign up to leave a comment.
  • akar-0 Avatar
  • user9644768 Avatar

    Ruby 3.0 should be enabled, read this to learn how to do it

    Please organize the structure of test fixture as following (although it has been mentioned in the attached link, I'm repeated here again)

    describe "<This message should describe the categories of test groups inside this block>" do
      it "<A short message describing this test group>" do
        expect(...).to eq(...) #Assertions
        #Or Test.assert_equals(user_response, reference_response)
      end
    end
    
  • imjasonmiller Avatar

    I've forked the Rust translation in order to update it to Rust 1.49 and updated rand::Rng::gen_range to its new signature that takes a std::ops::Range.

  • DietBepis1 Avatar

    Good kata!

  • buhinalba Avatar

    I see this in the python test cases: (16, 8 -> False) Why is this False? 16 => 10000 8 => 01000

  • JohanWiltink Avatar

    This comment has been hidden.

  • rowcased Avatar

    Python random tests expect 0 sometimes. While this does evaluate to False, the expected output should nonetheless be consistent.

  • anter69 Avatar

    Ruby translation kumited with updated description -- please check and approve.

  • Benjamin7991 Avatar

    If this function is meant to simply return a boolean value, why are some test cases implying that the correct output should result in 0? I'm assuming zero should only be returned if no two numbers share a bit? Attempting in python3..

  • JohanWiltink Avatar

    Haskell translation

    This translation includes the description fix for "at index 3" that got reverted by the Prolog translation.

    ( If you change the description before approving this translation, the translation will break. )

  • B1ts Avatar
  • dimitridev Avatar

    C++ translation rekumited.

    Has 50 false & 50 true random tests.

  • LagomarsinoHS Avatar

    Why 7 and 10 is false if 7 => 111 10 => 1010

    index 0 and 2 share the "1" so the premise of "returns true if 2 integers share at least two '1' bits" is true???? thx

  • Blind4Basics Avatar

    For example int seven = 7; //0111 int ten = 10; //1010 int fifteen = 15; //1111 SharedBits(seven, ten); //false SharedBits(seven, fifteen); //true SharedBits(ten, fifteen); //true

    hi,

    that part of the description is unreadable. Plz use either:

    • bullet points
    • code clocks
    • put 2 whitespaces at the end of each line (because I suppose they are written on different lines in the "description panel")
  • JohanWiltink Avatar

    ( JS, possibly others )

    Submit testing relies on random tests only. There should be fixed tests for edge cases.

  • JohanWiltink Avatar

    ( JS, possibly others )

    Please do not show 1000 it-headers. Webbrowsers do not like that. Collapse that into a single header. No, for succeeding tests we do not need to know what just happened.

  • webmisfit Avatar

    seven and ten share only a single '1' (at index 3)

    [0,1,1,1] - 7 [1,0,1,0] - 10

    => seven and ten share only a single '1' (at index !!2!!) ????????

  • Yaseen072 Avatar

    (7, 10) ['1', '1', '1'] ['1', '0', '1', '0'] why is this one supposed to return False?

  • rowcased Avatar

    C Translation kumited.

  • yuskivpm Avatar

    JavaScript translation. Please, review and approve.

  • FArekkusu Avatar

    Python translation. Please, review and approve (the author may be inactive).