• Hi, I'm doing this kata on c++, and I'm very confused on why I'm getting this output:

    Log
    3 2 3 6 4 1 2 3 2 1 2 1 2 2 2
    Expected: [ 1 ]
    Actual: [ 3 ]

    If someone could help me through this I would greatly appreciate it!

  • UnderNeko, see the sample tests:

    test.assert_equals(pick_peaks([1,2,3,6,4,1,2,3,2,1]), {"pos":[3,7], "peaks":[6,3]}) #  that's a dictionary
    #                                                     string:list                                                          
    
  • Same here, I would like to know if I am supposed to return string that looks like those in tests or some type of tuple or what? Coding in python

  • Post your code (with the spoiler tag).

  • I dont really know what I suppose to return

    I'm getting this Error-Message:

    should support finding peaks expected: SolutionTest$1<{pos=[3, 7], peaks=[6, 3]}> but was: java.util.HashMap<{pos=[3, 7], peaks=[6, 3]}>

  • Great kata, I had a lot of fun improving my solution.

  • thanks i didn't see 'question' tag my bad. This should help me out with the solution.

  • That's a question, not an issue, a plateau is a group of repeated values next to each other, see the examples in the instructions, they can be or not a peak depending on borders conditions.

  • i don't understand the concept of plateau mentioned in the problem if anyone could explain it would be great. Thanks!

  • You can check what are random inputs by yourself: https://docs.codewars.com/training/troubleshooting#print-input

  • My code works well with all delivered tests,
    yet the attempt-tests go wrong

    to debug, could s.o. give the attempt-input or some routine that creates
    random inputs please ?

    one of the following should be sufficient. The wronger the better

    {'pos': [1, 4, 8, 10, 14, 16, 19, 21],
    'peaks': [12, 15, 2, 10, 13, 13, 19, 15]}
    should equal
    {'pos': [1, 4, 6, 8, 10, 14, 16, 19, 21],
    'peaks': [12, 15, 0, 2, 10, 13, 13, 19, 15]}

    {'pos': [6, 11, 14, 18, 20, 22],
    'peaks': [18, 16, 18, 13, 10, 16]}
    should equal
    {'pos': [6, 11, 14, 18, 20, 22, 25],
    'peaks': [18, 16, 18, 13, 10, 16, 10]}

    {'pos': [2], 'peaks': [15]}
    should equal
    {'pos': [2, 5, 9, 12, 14],
    'peaks': [15, 18, 17, 19, 20]}

    {'pos': [2, 6, 10, 13],
    'peaks': [16, 13, 6, 4]}
    should equal
    {'pos': [2, 6, 10, 13, 16, 20, 22],
    'peaks': [16, 13, 6, 4, 13, 18, 17]}

    {'pos': [1], 'peaks': [5]}
    should equal
    {'pos': [1, 5, 9, 11, 13, 18],
    'peaks': [5, 9, 17, -1, 12, 16]}

    {'pos': [1, 5, 9], 'peaks': [20, 20, 20]}
    should equal {'pos': [1, 5, 9, 14, 16, 18],
    'peaks': [20, 20, 20, 16, 20, 10]}

    {'pos': [1, 5, 8, 11, 13],
    'peaks': [10, -1, 16, 11, 3]}
    should equal {'pos': [1, 5, 8, 11, 13, 16, 19],
    'peaks': [10, -1, 16, 11, 3, 20, 14]}

    {'pos': [1, 4, 7, 9, 13, 15],
    'peaks': [20, 9, 19, 11, 13, 18]}
    should equal
    {'pos': [1, 4, 7, 9, 13, 15, 18, 21, 24, 26, 28],
    'peaks': [20, 9, 19, 11, 13, 18, 11, 15, 19, 5, 15]}
    {'pos': [1, 3, 7],
    'peaks': [12, 11, 10]}
    should equal
    {'pos': [1, 3, 7, 12, 15, 17],
    'peaks': [12, 11, 10, 15, 10, 15]}

    {'pos': [5, 7, 9, 11],
    'peaks': [17, 13, 11, 11]}
    should equal
    {'pos': [5, 7, 9, 11, 15, 20],
    'peaks': [17, 13, 11, 11, 16, 17]}

    {'pos': [2, 4, 6],
    'peaks': [16, 12, 3]}
    should equal {'pos': [2, 4, 6, 11],
    'peaks': [16, 12, 3, 20]}

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

  • This should be a Question and you should mention the language you're using. And maybe show your code.

    Python Completions 5538

  • Am I the only one who gets time-out error?
    My code is kind of simple and it works perfectly - checked it on another platform.

  • Loading more items...