Ad
  • Custom User Avatar

    Both should be plateau-peaks. For that input (that is a random test), the control function expects you to return this:

    {
      pos: [
         3,  5,  9, 13, 18,
        21, 24, 28, 31
      ],
      peaks: [
        2, 11, 14, 15, 2,
        9, 15, 11, 13
      ]
    }
    

    And you see there the peak at position 28 with a value of 11 is expected.

  • Custom User Avatar

    Hello Chrono79,

    Why is the first seven a peak (position 5) -> [ 14, 1, 11, -3, -2, 7, 7, 1, 13, 12]
    But the number 11 in the position 28 isn't? -> ([15, 9, 0, 2, -1, 11, 2, -2, 11,14, 0, 10, 12, 15, 10, 10, 2, -4,2, -1, 5, 9, -2, 3, 15, 8, 2, 7, 11, 11, 5, 13, 10, -2, 11]

    Doesn't make much sense to me.. please help me

    I get the second array correct, but not the first one.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    Your code is wrong, and it's failing this test:

    assert.deepEqual(pickPeaks([3,2,3,6,4,1,2,3,2,1,2,2,2,1]), {pos:[3,7,10], peaks:[6,3,2]});
    

    It doesn't detect plateau-peaks.

  • Custom User Avatar

    I get errors in the tests that I don't get in repl.it and in my VScode file...

    I got the error saying expected X and result Y, but when I run in on my compilers I get the correct expected... getting crazy with this, can someone help me, please?