Ad
  • Custom User Avatar

    I am having problems solving the random questions.

    In the output I get
    array = [26, 28, 28, 1, 33, 7, 25, 16, 2, 1, 29, 15, 21, 31, 13, 25, 6, 10, 0, 26], Result: 0.0
    Expected value near 0.0000000000, but got 12.3371313493
    I can't see why this would not be processed and return 0. It seems valid to me. And how should 0 be processed.

  • Custom User Avatar

    thanks! seems so obvious when someone points it out...

  • Custom User Avatar

    Hopefully someone can help me with this, as I think I may have misunderstood.
    I have passed the sample tests.
    When I attempt I fail on where n is 25.
    I return false as the sum of primes less than 25 is 92 [2, 7, 11, 13, 17, 19, 23] and this is not evenly divisible by 25.
    The test is looking expects true though. What am I missing?!

  • Custom User Avatar

    Hi,
    I am strugglng with this, as I am not 100% sure on requirements. for the first test I get.
    [16, 25, 27, 30, 32, 49, 60, 64, 70, 81, 84, 90] rather than [16, 27, 30, 60, 70, 72, 84].
    For example I get 32 which seems correct. Prime factor is 2 only and 32 is divisible by 2.
    Can someone point me in the right direction. Thanks!

  • Custom User Avatar

    random tests don't seem to work in Python either.
    Same issue, expected result coming back with either empty list or with one item in only.
    thanks phju. Had to copy the list first.

  • Custom User Avatar

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

  • Custom User Avatar

    Thanks very helpful!

  • Custom User Avatar

    Hi I can't pass the tests when a string isn't passed. I thought this looked straightforward but seems not so for a beginner. My code
    function removeBMW(str){
    if (typeof str !== 'string') { throw 'This program only works for text.' }
    return str.replace(/[bBmMwW]/g, '')
    }
    Can someone help with what exception error I need.