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.
the problem is that it doesn't change at all the logic.
about testing: https://docs.codewars.com/authoring/guidelines/submission-tests/
errr... which isn't a good idea, imo, but...
The linked kata only asked for peaks whereas the one I posted asked for both local minimas and local maximas. I have also searched to find if there was any other kata asking for both of these and found none.
I have changed the kata to make it that the output of a plateau would be its starting and ending positions.
Being inspired != making an (almost) exact copy. This is a duplicate, and it should be unpublished.
For your first point I haven't figured out yet how to add the random tests with plateaus so I haven't added them yet. I will fix the problem with the oldest ages since I used it as an example to know what to put where. And the kata you linked actually gave me the idea to create this one but instead of only locating local maximas (peaks) in this kata you have to locate both local maximas and local minimas in order to get the solution right. I will add a section to the description that I was inspired by this kata.
Indices 10 to 12 does not make a plateau because they aren't at a local maxima or local minima state, in this example after these indices there's a -4 which will be less than the consecutive -2s. Hope my explanation made it clear.
Hi,
Note that having different kinds of data types is generally a bad idea. It makes your kata harder to translate to some languages (and more generally, it's a bad design anyway). So you should ask for a list of lists in all cases, even if no plateau (=>
[[1,1], [5,8], ...]
)cheers
[5,2,2,2,4,-2,-7,-7,-7,9,-2,-2,-2,-4,3,4,5,6,4,2,21,1,2,2]
Is there not a plateau at index 10 to 12?
Something was bugging me about the tests for a while, I just understood what. A fixed test with an array of size 2 needs to be added in all languages (and it would be good to enforce some in the random tests, just like with the tail/head cases).
It would be better to specify the minimal length for the inputs in the description, and the fact that there will always be at least one breaker in the input has to be stated.
ok
advise: don't approve translations if they do not comply with the other existing versions (as you can see, it increases the mess by a huge factor)
I've created this kata assuming unique values. C# and JS have unit tests for that case. I think updating description will be the best. But we need to update Python's tests too.
edge cases needed if going with the last point:
[0,1,5,1,10,19] -> 5
[0,1,0,1,1,9] -> 1
[-10,1,0,1,1,9] -> 1
Loading more items...