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.
list don't change
How people think to produce code like this? This perfect work and don't understandable for me.
idx
andi
can be removed.That's strange but in solutions from my name have publicked difference code. This code is slightly different from the code that I have submitted.
The interpreter decided to publish ))
Attention! The
var frogJump
detected!Your code running in range 0ms - 2ms. Cool!
Many thanks myjinxin2015
I did not take into account "All the elements are 1(absolute) difference from its neighbors."
I read this like "elements difference from its neighbors" (Even though the font is bold).
Key for optimization apparently in
Math.abs(arr[i]-arr[i+1]) == 1
.I must don not forget that simultaneously master two languages: JS and native En.
Your code running in range 0ms - 14ms
No more knowledge what to delete or change i++ vs i+=1 or something else. It looks like a fine-tuning - guessing game.
One word "performance".
Finally it's done.. but with some nuance..
May be 6ms per test sometime reverse to 9ms per test..Who knows?. Just... for couple of test - not for all ))
Sometimes we can see this message in couple of tests: You code is too slow ;-) - Expected: 'Less than 6ms per testcase', instead got: '9ms'
It's Mr Performance. I have just deal with it (temporarily)
I very enjoy to solve this one. Many thanks.
The rows
var prime=[]
andprime.push(a)
were used for debbug and don't nessesary in final solution.Hi,
It's some troble with this. If return include last item we get indefined
console.log(maxZeroSequence([5,4, -9,8])) // [5,4,-9]
console.log(maxZeroSequence([5,4, -9])) // undefined
How good kata is - where there are no performance and others non-kosher things like BST, memoization and combinatorics (irony). I put my "very" in satisfaction rating (seriously). IMHO 5 kyu is too much.
As usual in performance problem I get Process was terminated. It took longer than...
Stability is a sign of perfect skill (irony)
n=length-1
indexOf(n)
Apparently indexOf(n) spent all my time ))
This comment is hidden because it contains spoiler information about the solution
Loading more items...