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 comment is hidden because it contains spoiler information about the solution
Thanks! A bit rusty and forgot. Added.
Whoops, thanks for catching that! Should be fixed now.
Thanks! :)
Thanks again!
Thanks! Good catch.
I've updated the random tests to test within an epsilon.
Not sure what they meant either. A Kata which required you to just use a built-in
invert
would be an 8kyu. This one is a bit more difficult so I estimated 7kyu (which ended up matching the average rating given by beta solvers).I was also surprised nobody had done this. I searched for a few different keywords but nothing relevant came up.
Hope you enjoyed the solve!
Awesome, thank you!
It is frustrating that the Ruby kata defines the struct as named
Vector
which shadows the normally availableVector
class available in Ruby, which would be my preferred approach for solving this problem.That's fair, probably should have been enough. Thanks! Will mark this resolved.
I don't disagree, but I don't fully agree either. Mathematically a range is all possible outputs, inclusively. In Ruby, instantiating a range defaults to inclusive as well (
Range.new
defaultsexclude_end
tofalse
). I don't think either is more "correct", you just have to be explicit about which is expected. Most other kata that tests one way or the other mentions it in the description.I really don't think it's a big deal but it was a bit surprising to see the tests changed after the fact (failing solutions now considered "faulty") when this distinction was not made or updated in the description.
I originally tried this kata during one of Codewars' busier periods so was getting maybe 50% timeouts. I came back when things were quieter and had no problems. I wouldn't stress out about it too much, mentioning it in the description was plenty so I didn't feel too frustrated by it as it was somewhat expected.
I suspect concurrency is intentionally disabled as it would offer a way to get around the 12-second execution timeout and do more computation on Codewars' servers than they'd like.
Ruby. Reading below, this change was likely due to the comment below mine where Unnamed/Voile considered assuming inclusivity as "faulty". Honestly it's a bit ambiguous so just adding one way or the other to the description would suffice.
The tests have been changed to treat the range as exclusive but this is not mentioned in the description at all.
It should be possible using webmock which luckily is one of the gems Codewars makes available. This would eliminate any sort of actual network request or variance in response (though admittedly may result in future leaderboard members no longer being able to scrape themselves :/).
Unluckily, it seems to not work with MRI 2.5.0 yet.
EDIT: Also just noticed the repo I linked to is obselete. The newer docs do not list webmock as available in Ruby 2.5.
EDIT2: It will be added soon :)
Loading more items...