Ad
  • Default User Avatar

    Maybe one boat is in contact with anyother boat ,you can limit the number of 1

  • Custom User Avatar

    Looks resolved, right?

  • Custom User Avatar

    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

    1. Get the array at the ith spot
    2. and then get the first element of that array

    I realize this is a year later but i figured i could still answer.

  • Custom User Avatar
  • Custom User Avatar

    This is so clean. Please consider to add comments I really would like to understand how it works and the logic behind.

  • Custom User Avatar

    Not exactly, this time:

    Pause between characters inside a word – is 3 time units long.
    Pause between words – is 7 time units long.

    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.

  • Custom User Avatar

    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?

  • Custom User Avatar

    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.

  • Custom User Avatar

    Ok, i thought there were only 0s and 1s because of the simplicity of checking if 1+1+1 % 3 = 0

  • Custom User Avatar
  • Default User Avatar

    111 in binary is 7 in base 10. (not divisble by 3)

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    with what input? What are you returning exactly (on the coding side: what statement is it on your side?)

    And paste your code here (with proper markdowns and spoiler flag)

  • Custom User Avatar

    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<[]>

  • Custom User Avatar

    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 be List.of() or any other version of an empty list. Problem being that the assertion message show the stringified version of the returned list, in which List.of("") will show up in the exact same way than List.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() or new ArrayList<>(). So definitely no issue, yeah.

  • Loading more items...