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
I'm not sure this deserves top place for Best Practices: it couples the constructor to an instance method. As it's a constructor, the instance is yet to exist, and this sort of flaunts the purpose of OOP in Ruby.
same case
It is
Just solved in Go.
My solutions was assuming the array of indices was sorted based on the examples and it woked for all the solutions.
I was also asuming the array contains no negative indices.
But, reading the description, the assumptions were just not correct.
About the first assumption, I suggest to either ...
About the second assumption, I suggest to either ...
This comment is hidden because it contains spoiler information about the solution
I think that there must be some issues in GO (golang) tests.
I belive I've the solution. The only doubt I've is when both arrays are empty. For the moment, I'm presume the result should be
true
in this case.My solution passes all the initial tests, all the random tests and many of the "basic tests", but one of them is failing.
I've placed logs to see where my solution was failing and it's when both arrays are empty (It was expected to be
false
). So, I changed the condition to returnfalse
in this case and the new solution still fails and still does when both array are empty, but now, it seems to be expecting the result to betrue
.I haven't seen the tests but it seems that a test case is duplicate but with different expected results...
Please, can someone confirm?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
good idea
I hope you enjoy this solution ;)
Using
arr.toSet()
instead of justarr
as optimization for really long arrays. Usually, it won't be necessary.Hi, I've just submitted a solution knowing it won't work with negative integers.
I suggest you update either the definition to exclude negative integers or the test cases to test negative integers as well.
This comment is hidden because it contains spoiler information about the solution
It's part of the task requirement
Loading more items...