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 expected and actual values in random tests are flipped.
It also passes the same object to reference solution and user solution, so user modifying input can influence the tests (if the above is adjusted).
This is 99% duplicate: the only difference is you also need to find the subarray location here. But it is relatively trivial comparing to the core task.
The provided example beneath this sentence is not a valid example. The actual example is under the Notes section.
"Closest to top left corner" is not well-defined enough to unambiguously specify what is "first".
I finally started crafting a good solution to this after thinking about it for about 3 hours and then accidentally refreshed the page and lost all my work. End me.
Update: Alright I have something but I'm failing the random testcases for weird reasons. It's saying my answer is wrong but the provided answer has the left index higher than the right index, e.g.
[0, 9, 10, 89, 5194] should equal [27, 9, 10, 89, 5194.0]
[0, 0, 4, 34, 1159] should equal [12, 0, 4, 34, 1159.0]
[39, 0, 47, 15, 1916] should equal [84, 0, 47, 15, 1916.0]
https://www.codewars.com/kata/59ccf921a25c8c96460000ff
(There are more)
Duplicate of what? This cata was created 4 years ago
Duplicate.
Thanks, glad you like it:-) - by the way good work, hope you lost not too much time;-)...
This is a great kata! The biggest difficulty was ofcourse unary minus but it was a pleasure to debugg great task :)
For others: read the text carefully, I missed a few words and lost a lot of time because of it.
Thanks, I'm glad you like it. Hopefully enough people will complete it that it makes it out of beta!
I think your
and
is messing you up here. Looking at your logic, do the expressions on both sides of yourand
operator evaluate to true when it's sunny and the rain chance is < 0.5? In that case I think you want to be returning true but I don't think your logic matches that.Perhaps a simpler way to think about it being sunny is to say "Take an umbrella if it's rainint OR if it's cloudy and looks like rain OR if it's sunny and the forecast is for rain."
This comment is hidden because it contains spoiler information about the solution
Added example tests just now, thank you for the suggestion.
Great idea for kata.
Thanks to you I found yet another way to deal with generators :)
Loading more items...