Ad
  • Custom User Avatar

    While true, that would be non-euclidean chocolate, you cannot have a 1 dimension physical object.

  • Custom User Avatar

    We have deployed some changes. Is this still an issue?

  • Custom User Avatar

    Maybe related to today's update, I seem to be missing 300 honor both at the top of every screen and persistently enough to impact the leaderboard.

    (This has been fixed)

  • Custom User Avatar

    same problem...
    /e
    solved it!
    thanks for test cases :)

  • Custom User Avatar

    Just started out using Codewars and I was starting to wonder if the timeout was just referring to me taking to long to solve the problem. Glad it's not the case.

  • Custom User Avatar

    Since 2 days I'm getting "Submission timed out." all the time...

  • Custom User Avatar

    don't like this... My Test shows me the array from 0 to 3000 and no problems with timeout... How far do I need to be able to go here?

    Edit:
    This returns an empty array []. If I reduce the range from (700,1000) to (700,999) I get all prime numbers... So when I try to submit, I pass many tests but at some point there comes a range that my algorithm doesn't solve... why's that? Please try not to spoil too much in the answers. I want to be able to see them. Btw: How can I indent my code?

    function isPrime(number) {

    if (number < 2) return false;

    if (number == 2 || number == 3 ) return true;

    for (var i=2; i<Math.ceil(Math.sqrt(number))+1; i++) {

    if (number%i==0) return false;

    }

    return true;

    }

    function getPrimes(start, finish) {

    var a = [start, finish];

    a = a.sort();

    for (var i=a[0],res=[]; i<a[1]+1; i++) {

    if (isPrime(i)) {

    res.push(i);

    }

    }

    return res;

    }

    Test.assertSimilar(getPrimes(700,1000),[...]);

  • Custom User Avatar

    I get the same error message "Test Failed: maximumSum with n>values.length not working as expected" but I pass the test you offered (Test.assertEquals(minimumSum(new Array(5, 4, 3, 2, -11), 8), maximumSum(new Array(5, 4, 3, 2, -11), 8));) ... No idea what to do.

  • Custom User Avatar

    Yes, I believe the given information is enough to google the rest. I learned a lot by researching how to add a function to a protoype.

  • Custom User Avatar

    neither do I... What exactly can the input be? More than just numbers?

  • Custom User Avatar

    yes, that's the reason.

  • Custom User Avatar

    What if e.g. n>1, m=0? Function should return zero, but returns n-1.