Ad
  • Custom User Avatar

    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

  • Custom User Avatar

    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] /n
    But between 359 and 367 there is 361 that is prime. so... what i am missing? Is the only test of 100 that goes bad

  • Custom User Avatar

    "a" is the array, to know the length of the array to add the correct amounts of "0" - "y" wich is the index

  • Custom User Avatar

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

  • Custom User Avatar

    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

    [
    ["130/90","140/94"],
    ["160/110"],
    ["200/120"],
    ["150/94","140/90","120/90"],
    ["140/94","140/90","120/80","130/84"]
    ] 
    

    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

  • Custom User Avatar

    how this can be Best Practices?... i mean is clever for sure, but it is really dificult to read

  • Custom User Avatar

    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?

  • Custom User Avatar

    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

  • Custom User Avatar
  • Custom User Avatar

    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

  • Custom User Avatar

    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

  • Custom User Avatar

    really nice and clean code, taking notes...

  • Custom User Avatar

    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

  • Custom User Avatar

    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

  • Custom User Avatar

    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...