Ad
  • Custom User Avatar

    Codewars is My Math Tutor +2

    Anybody Else To Count Up?)

  • Custom User Avatar

    edit: self-catch
    (chuckle)

  • Custom User Avatar

    awesome catch, thanks

  • Custom User Avatar

    There is one more serious issue discovered while translating for NASM.
    Some implementations including first of mine do not check for x overflowing under y.
    Look at the case 've just added to the C translation:
    cr_assert_eq(divisible_count( 64, 73, 27 ), 0 ); /* case to check for correct overflow implementations */

    Do not know what about the other languages...
    But this case or similar should be added!

  • Custom User Avatar

    I'd say add to the description that the numbers are positive, just to not render all current solutions invalid.

  • Custom User Avatar

    I guess college level calculus is basic math

    When I studied calculus I had to deal with limits, derivatives, integrals, and you're telling me "dividing 2 numbers" is as advanced. Either you've never studied math after school, or American education is even a bigger joke than I've heard :trollface:

  • Custom User Avatar

    calculus? lol, I never even took trigonometry. I guess I've just learned how to visualize numerical relationships and hack away with various tools like modulus and whatever. codewars has been my higher maths education, ;)

  • Custom User Avatar

    rowcased, that's great that you overcame it. I tried a lot of different iterable solutions because I assumed there was one that was more optimized and that is what I was missing. I know more of what O(1) implies now. I guess college level calculus is basic math?

  • Custom User Avatar

    When I solved in Python 5 months ago, I also hit the wall with the tests, at first. Unaware of any possible formula and without google I just persisted and came up with my own solution (that actually did use some looping). I started self-teaching programming a couple of years ago & have just the most basic maths education, but I still enjoyed this kind of challenge.

  • Custom User Avatar

    You seem fairly outraged over a trivial comment, you should probably take a breather. This is a place of learning and discussing, not toxicity.

  • Custom User Avatar

    Code challenges are a test, on a test you can't google anything

    Yeah, we should ban Google, burn all the books and research papers, delete all software libraries, and do everything on our own because that's obviously how software development works. Using the Internet is not allowed during exams because it can be used for cheating (searching for answers on the Internet, asking other people for help etc.), and it's impossible to prevent the latter without banning the former. And if you haven't noticed, this is not an exam.

    If I have to google the mathematical formula for number of divisible numbers in a range

    Sounds like you don't know basic math, but whatever.

  • Default User Avatar

    Negative numbers are currently allowed, but there are no such tests.

  • Custom User Avatar

    Code challenges are a test, on a test you can't google anything. Additionally, on a math test they tend to give you formulas for things you will encounter. In this case if the formula is provided you are still testing their ability to make it work with the limits placed, and removing the requirement to memorize formulas as I'm sure even senior programmers don't have all math formulas memorized.

  • Custom User Avatar

    Finding an algorithm that works with a certain input range/value is programming work. Is math involved in that? Yes. Should you google for that? Not necessarily.

  • Custom User Avatar

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

  • Loading more items...