Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
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.
Oh wow that makes way more sense, thanks
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.
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);
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
I had the same problem as you, I posted a question about it.
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