6 kyu

The OR sum

58 of 69Yushi.py
Description
Loading description...
Mathematics
Bits
Performance
  • Please sign in or sign up to leave a comment.
  • tobeannouncd Avatar
  • goldenratio161 Avatar

    This comment has been hidden.

  • shekelboi Avatar

    Only 6 kyu? It seems quite tricky, maybe if I manage to solve it, I'll understand why it's only 6 kyu but right now it definitely feels harder.

    • Yushi.py Avatar

      It really depends on your mathematical background. If you're familiar with sequences and bitwise operations, it's quite trivial. Otherwise, it can take you quite a while.

      Good luck solving it though, I hope you figure it out :)

  • avermakov Avatar

    There's a similar kata already, not exactly a duplicate though:

    https://www.codewars.com/kata/56d3e702fc231fdf72001779

  • dfhwze Avatar
    • Yushi.py Avatar

      Wow, it's quite rare for me to have a kata without any issues and only a translation in the discussion section.

      I find it quite amusing how you defined the Python exclusive functions in JS, like randint and range. I feel like the things I do in Python may not be the best or easiest to implement in other languages.

      Anyways, I was looking through the translation, and it looks fine. I just thought it's weird that, in the random tests section, it states that each batch of 10 or 20 tests is only 1 test. 

      Looking more into it, it seems to work as intended for passing cases, breaking early upon a fail. I just wanted to know if that's intended. It's just a bit weird for me to see 35 passed tests in a passing solution if 100 random tests were stated.

      I just want to clear up this confusion of mine, and then I'll be sure to approve it. Thank you very much for the translation :).

    • dfhwze Avatar

      Yep, it is correct that there appears to be less random tests than there really are. Each batch fails early on first test that fails. I could change that if you want. In fact, since there are only 10 - 20 tests in each batch, I could run them all, regardless of early failure. Lemme change that.

    • dfhwze Avatar

      I changed the random tests. Could you verify?

    • Yushi.py Avatar

      It was fine the way it was; I just wanted to make sure it worked as intended. But it's good the way it is now as well.

      Just one thing: aren't you missing the Special tests? They aren't all that important, and I could remove them if you think they're unnecessary, but I'd say it's good to have all versions be consistent with the tests.

    • dfhwze Avatar

      ah yes, there are special random tests too. I only just noticed. Lemme add them ..

    • dfhwze Avatar

      special cases added

    • Yushi.py Avatar

      Yeah, it all looks good now. Sorry for being annoying, I just wanted to ensure that all versions were consistent. Thanks you very much.

      Suggestion marked resolved by Yushi.py 13 months ago