Ad
  • Custom User Avatar

    Oh hahahaha okay that's my problem then. I didn't know the tests were affected by me messing with the array. Thanks, that makes way more sense now because I was taking off two of the items. I didn't know why that would change the tests though, haha! Sorry for all the confusion.

  • Custom User Avatar

    Oh wow that makes way more sense, thanks

  • Custom User Avatar

    That would make sense if I was removing items from the array, if the array came in as shown above shouldn't the answer be 46? My answer was 46, but it says it expected 96.

  • Custom User Avatar

    Are you saying that I modified the original array by logging it at the beginning? Sorry just trying to understand if I'm doing something wrong. This problem is called "Sum of two lowest positive integers" wouldn't that mean the lowest two positive integers were 13 and 33? It just seemed like the answer was removing the two lowest, and then taking the next two lowest. This is how my function starts:
    function sumTwoSmallestNumbers(numbers) {
    console.log(numbers);

  • Custom User Avatar

    The answers on the test cases are wrong if I'm thinking this is supposed to work the way they said:
    [ 17, -31, 3, 23, 5, 19, -27, -42, -25, -26, -21, 2, 43, -5, 23 ]
    Expected: 63, instead got: 66

    Shouldn't this answer be 66 because it would be 43 + 23?
    Language: JavaScript

  • Custom User Avatar

    I had the same problem as you, I posted a question about it.

  • Custom User Avatar

    The tests are saying the wrong answer. I logged the array before I did anything, and the bottom two numbers in this array should have been 13 and 33 which would be 46. The test thought it should be 96.

    should finally work for random tests
    Log
    [ 1072, 13, 33, 42, 54 ]
    Expected: 96, instead got: 46