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.
This is far harder than 7kyu. PLZ make it 6kyu at least.
it's work, but timeout sometimes.
This comment is hidden because it contains spoiler information about the solution
Danm!I love this solution!
How dose this work?!!
Thanks for your suggestion.
I have to admit my solution is not good enough at performance , and your code is better.
Too easy for 5 kyu,it should be 6 or 7 kyu
Maybe you need to read the description more carefully.
In this case,first take 2 elements from [1,1-1] ,it can be [1,1] or [1,-1],so there are two difference:
[1,1].max-[1,1].min=0;
[1,-1].max-[1,-1].min=2
Use the minimul difference as the final result.
NOT just get the max and min from the whole array.