3 kyu

No More 5's, Ever

57 of 77M1Miketro
Description
Loading description...
Number Theory
Mathematics
Memoization
  • Please sign in or sign up to leave a comment.
  • Zanamo Avatar

    How much of Combinatorics does this kata need? Like I guess around 30%-40% is all about combinatorics to find the numbers which contain "5" in them.

  • asmyshlyaev177 Avatar

    Have test.assertEquals(no5s(16384, 32768), 0, 'a = 82, b = 43') in JS version again.

  • user8539764 Avatar

    Great problem super tricky

  • user8396369 Avatar

    This comment has been hidden.

  • omadDB Avatar

    There is something wrong with the test cases. It gives an output "a = -50029, b = 21093: expected 29800 to equal 11654", but in VS Code console.log() it is actually 29800. Could you please fix it.

  • dfhwze Avatar

    Placeholder, I notice in Python the solution setup is not correct. I'll fix it.

  • hobovsky Avatar
    • Test snippets are missing imports for solution and codewars_test
    • Please use something clearer than tyjsdfgbwr, jewthysgfkwenhfdg, etc. I am not sure if there is any reason to use obfuscated names, but if there is, at least provide original names as a comment, or something.

    Javascript:

    • Sample tests still use the compat module instead using mocha directly.
  • orgr74 Avatar

    Hi guys, as the first 10 positive numbers that should be counted are 2, 3, 4, 6, 7, 8, 9, 11 the fixed test test.assert_equals(no_5s(2, 10), 7, 'a = 2, b = 10') should report 6 and not 7. Shouldn't it?

  • Voile Avatar

    The new sample tests added later have incorrect message strings, like test.assert_equals(no_5s(16384, 32768), 0, 'a = 82, b = 43').

    (Also, there should be bigger inputs in sample tests. Not as big as to time out using the simplest approach, but takes around 1-2 second to finish.)

  • monadius Avatar

    JavaScript: do not use @codewars/test-compat. Replace test.assertEquals with assert.strictEqual where assert = chai.assert.

  • uttumuttu Avatar

    In random tests, no_5s(-24583, -9886) expects an answer of 11570. This cannot be the correct answer, as most of the 11570 numbers are five-digit numbers. Or does the rule apply differently to negative numbers?

  • dfhwze Avatar

    What is "up" or "down" when looking at negative numbers?

    If a and b are not integers, round a up and b down.