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.
I think because in the sum prototype he gives an initial value of 0 in the reduce function. So if an empty array is passed that will be the default value
I think there is an issue in a test of JavaScript, correct me if im wrong.
From this input(8, 300, 400)
expected null to deeply equal [ 359, 367]
/nBut between 359 and 367 there is 361 that is prime. so... what i am missing? Is the only test of 100 that goes bad
"a" is the array, to know the length of the array to add the correct amounts of "0" - "y" wich is the index
This comment is hidden because it contains spoiler information about the solution
I don't get it, maybe is 'cause my inglish is not to good but i will share my doubts:
In the array of example of the instructions
it says that # patients at index 0, 2, and 3 are hypertensive;
why at index 3 and not also at index 4? it s because have to be the the last two elements of the array consecutive? I mean the 4th array have 140/94 and 140/90 but the last two tests of hypertension give 120/80 and 130/84 so in conclusion doesn't have hypertension? And if its like i interpret it i have to check only the last two test of the patient and all the other test are noise? I will gladly apreciate an answer. Have a good day/night
how this can be Best Practices?... i mean is clever for sure, but it is really dificult to read
I flatten the array "by hand" and it works so the only problem was that. Maybe because and old version of node or what can may be?
Im in JS, when i run the tests it gives me a message saying: "arr.flat is not a function"... anyone knows why? because i run the same code in other plataform and it work just fine
Its in JavaScript
I have an issue... i run my code on RunJS and there all the test cases pass fine but when i copy the same code and run the test here not passes all of them and with a console.log i see that here it works really weird. How can i do to solve this?
Here in this test case: coinsNeeded(123,[1,2,5,10,20,50]) the console.log shows me that only uses to reduce the amount by 5...
but in my RunJS its reduced properly as shown in the sample test (50+50+20+2+1). I will copy my code here for you to test it in diferrent places but idk if its correct doing that here. So i wait for a response to try to solve my problem. Thank you and have a good day
Why the "+" at the start of the return makes the string into a number? and if i put a "-" instead of the plus symbol makes the negatives go positive and viceversa? I want to know how it works, if someone can explain me or send a link of MDN, i can't find it. Thanks
really nice and clean code, taking notes...
can you resolve this algorithm with only reduce? i used for loops and in cases with 6 digits it crashes. I tried to submit it more than 3 times but there is no case
my code time out only with big numbers but all the other test passes, i should try to do a more efficient algorithm? I wrote it on javascript
I attempt it and passes 105 and failed 3 but i can't see how it looks the ones that failed...
i don't know if its something wrong with my code or is an issue.
A test can bring a face like this: ["~D:"] ? because if it can maybe that it's my issue but it not seems like it because only 3 examples of it.
Loading more items...