Ad
  • Custom User Avatar

    I am also stuck there

  • Custom User Avatar
  • Custom User Avatar

    you said pickpeaks should not ignore peaks.
    Did you change your mind? Cause when I'm trying to submit I get:
    " should support finding peaks, despite the plateau
    ✘ {'pos': [2, 3], 'peaks': [3, 2]} should equal {'pos': [2], 'peaks': [3]} "

    is this a bug? The instructions don't mention this and it would at least need another parameter to determine whether ignore peaks is on or off for that special case. Definitely not solvable without a proper set of instructions for this case.

  • Custom User Avatar

    Just a reminder:
    The return type is a dict rather than a struct for Python, if you are new to Python and it confused you...

  • Custom User Avatar

    for Python:
    should support finding peaks, despite the plateau
    ✘ {'pos': [2, 3], 'peaks': [3, 2]} should equal {'pos': [2], 'peaks': [3]}

    I feel like I'm missing something, but I have no idea what exactly... is the algorithm supposed to ignore all plateaus if a certain parameter is given? If so the description doesn't mention this requirement at all. This test case is very vague and I can't decipher it's meaning or purpose.
    Right now I feel like this is impossible to finish without the proper info.

  • Custom User Avatar

    There are no example testcases so nothing is running. Run the fixed testcases instead by clicking the "Attempt" button.

  • Custom User Avatar

    test says:
    Response received but no data was written to STDOUT or STDERR.
    what does this mean?

    my function ends with "return decimal" in case of any doubt it would at LEAST return 0

  • Custom User Avatar

    no, I believe this is as fast as it gets (at least in asymptotic runtime - which is # of candidate times max(length of candidates))

    i guess if you really wanted to optimize you could reduce the time counting length of the words by instead of using len() writing your own counter that interrupts as soon as candidate length becomes bigger than word length. now your upper limit is # of candidates times word length

  • Custom User Avatar

    well...
    expecting us to create our own prime numbers up till n is quite the heavy assignment when having to guarantee a runtime <12000ms that's when the code will time out...
    sadly though the code wasn't even running for 12 seconds before it decided to time out...
    was trying a Sieve of Eratosthenes approach on generating the primes but apparently it takes too long so I'm clueless how to proceed.

  • Custom User Avatar

    doesnt that just return a triangle?