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.
Unnecessarily high time complexity O(n^2)
Edited.
Edited.
Actually, due to the differences in the input range, the solutions (at least mine) to these two problems completely differ, and each solution is not strictly better than the other. As you see, the
L
andm
(the size of the alphabet) in Ver 1 is greater than those in Ver 2, but in Ver 2n
is greater than in Ver 1 instead -- so I don't think they duplicate.Thanks for correcting me and sorry for my poor English. And IMHO, I think the following statement might be clearer:
How do you think about it?
Well I'm closing the issue...
Thanks for pointing it out.
@B1ts he means "A positive integer with no leading zeros and a difference of at least two between adjacent digits is called a yuyuggg number.". For example, 24 is a yuyuggg number since the absolute value of (2-4) is 2, which is bigger or equal to 2 mentioned in description, while 34 is not. For edge cases, a number with a single digit is also a yuyuggg number.
Almost trash kata...
First of all, your test cases are wrong. You should look into your code and find that you should write
instead of
Secondly, your code can obviously cause undefined behaviors at
since
pre
can be a negative number (-2
) when accessing the array. With this simple test case it can be easily reproduced:10 10
.Thirdly, avoid commenting with native language since it doesn't help people except those in your country understand anything.
Lastly, your test cases are written in a really bad manner. Answers should be evaluated INSIDE the
It
block, but not out of it. And, since warriors could see their programs' output during the test, you should add some random tests to avoid programs with pre-calculated answers from passing the tests. Your example test cases cannot even get compiled successfully!BTW, there're some minor mistakes in your kata description. I think you mean "A positive integer with no leading zeros and a difference of at least between two adjacent numbers is called a yuyuggg number.". And "a" and "B" in the later part of the description should be in the same case.
Well, I don't understand Haskell and the translation is contributed by @JohanWiltink... But maybe I can check his JS code and find his mistake.
Sorry but... I didn't ever realize that solvers are able to print some debug info during tests...
Sorry for that... And the problem is changed now.
Well, what the problem is asking is exactly the distance between two points, but I made it become (the minimum time * 2) so that the problem is partly close to the plot. However, as you think it's kind of midleading since units of time not divisible, we'm to edit it later ;)
Okay, pardon me for my carelessness. I didn't realize that you can view my final tests so i assumed that you were talking about example tests. It's fixed now.
Actually if you look carefully it should be:
maybe you edited the example tests by accident?
Loading more items...