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.
Maybe one boat is in contact with anyother boat ,you can limit the number of 1
Looks resolved, right?
so get the thing, in this case an array at the ith index, and then since we know it is an array, just get the 0th index
in other words to match our example
I realize this is a year later but i figured i could still answer.
... why?
This is so clean. Please consider to add comments I really would like to understand how it works and the logic behind.
Not exactly, this time:
So the code there doesn't show spaces as the previous kata. Look at the binary code below, you'll see time unit is 2 and there is a bunch of 14 zeroes that represent the space.
Description says that ···· · −·−− ·−−− ··− −·· · is HEY JUDE but as seen in the previous kata, there should be 3 spaces between Y and J, am I right?
There are no tests where wrong-shaped extra ships are placed surrounded by water.
I know this because in those cases my code would fail (returning true instead of false), but it doesn't because there are no tests like that.
An example:
{{1, 0, 0, 0, 0, 1, 1, 0, 0, 0},
{1, 0, 1, 0, 0, 0, 0, 0, 1, 0},
{1, 0, 1, 0, 1, 1, 1, 0, 1, 0},
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0},
{1, 1, 0, 0, 0, 0, 0, 0, 1, 0},
{0, 1, 0, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}
My code checks everithing but those cases, and passes all tests. Please fix that.
Ok, i thought there were only 0s and 1s because of the simplicity of checking if 1+1+1 % 3 = 0
^ That.
111
in binary is7
in base 10. (not divisble by 3)This comment is hidden because it contains spoiler information about the solution
And paste your code here (with proper markdowns and spoiler flag)
I am getting the same error and I used Klopma's workaround method but I still get the AssertionError expected: java.util.Arrays$ArrayList<[]> but was: java.util.Arrays$ArrayList<[]>
then you are wong, I believe. ;)
What I was saying is that I bet that the assertion message doesn't show is that returned list is
List.of("")
while it has to beList.of()
or any other version of an empty list. Problem being that the assertion message show the stringified version of the returned list, in whichList.of("")
will show up in the exact same way thanList.of()
. So there is definitely no issue here and it's just about foloowing the logic of the problem correctly. ;)EDIT: just to make things clear: I even checked that the assertions pass correctly returning any of those:
List.of()
,Arrays.asList()
ornew ArrayList<>()
. So definitely no issue, yeah.Loading more items...