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.
... why?
This is so clean. Please consider to add comments I really would like to understand how it works and the logic behind.
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
This comment is hidden because it contains spoiler information about the solution
Don't start with an example. Explanation is not very useful.
why?
I meant HE is right, I think it should not be difference between an empty List and a Array.toList() as the function is expected to return a List
I would suggest to add upper case examples to avoid confusion.
You are right, it is a Type bug with empty arrays. I do this workaround: if result.length == 0 return Arrays.asList()
Input: As shown above.
Errors for both examples:
Incorrect match: wcG, tTyTYHCkoq, zgkNeZQ
Incorrect match: dlGh
I think random tests are not working on Java 11 as I mannually checked results and seem to be fine. Some examples:
uxUKZjc,YoJVIJto:xWoulrbb YoJVIJto cRn;cRn/tTyTYHCkoq cRn tTyTYHCkoq/tTyTYHCkoq xWoulrbb_wcG cRn uxUKZjc xWoulrbb-tTyTYHCkoq wcG:cRn xWoulrbb_wcG tTyTYHCkoq:wcG.tTyTYHCkoq-uxUKZjc wcG cRn zgkNeZQ wcG tTyTYHCkoq;wcG uxUKZjc:uxUKZjc:xWoulrbb/uxUKZjc.tTyTYHCkoq!tTyTYHCkoq xWoulrbb tTyTYHCkoq?uxUKZjc xWoulrbb.cRn/tTyTYHCkoq-wcG zgkNeZQ;YoJVIJto wcG uxUKZjc/YoJVIJto tTyTYHCkoq wcG.zgkNeZQ YoJVIJto cRn/zgkNeZQ uxUKZjc/tTyTYHCkoq-cRn-wcG zgkNeZQ uxUKZjc zgkNeZQ_zgkNeZQ uxUKZjc_wcG!tTyTYHCkoq?xWoulrbb/xWoulrbb zgkNeZQ wcG!zgkNeZQ/uxUKZjc cRn cRn uxUKZjc xWoulrbb xWoulrbb_zgkNeZQ wcG/zgkNeZQ,YoJVIJto!YoJVIJto?zgkNeZQ,uxUKZjc zgkNeZQ xWoulrbb tTyTYHCkoq wcG xWoulrbb YoJVIJto!uxUKZjc tTyTYHCkoq!zgkNeZQ zgkNeZQ uxUKZjc!zgkNeZQ wcG wcG tTyTYHCkoq-tTyTYHCkoq uxUKZjc YoJVIJto:YoJVIJto-zgkNeZQ/xWoulrbb/tTyTYHCkoq tTyTYHCkoq:wcG tTyTYHCkoq cRn:wcG zgkNeZQ:zgkNeZQ/wcG-wcG;tTyTYHCkoq.wcG!tTyTYHCkoq zgkNeZQ zgkNeZQ;wcG uxUKZjc_YoJVIJto cRn tTyTYHCkoq wcG,cRn:wcG tTyTYHCkoq,
result.toString():
[wcG, tTyTYHCkoq, zgkNeZQ]
dlGh?dlGh_dlGh.dlGh/dlGh dlGh dlGh dlGh dlGh-dlGh?dlGh dlGh dlGh-dlGh dlGh dlGh;dlGh/dlGh_dlGh dlGh dlGh dlGh dlGh dlGh dlGh dlGh dlGh;dlGh
result.toString():
[dlGh]
Imposible to solve in java, AssertEquals is not in the correct order, if you return "abc" it says "expected abc but was covfefe". Fix it, it's easy to fix, come on!
Assert equals is not in the correct order. Is expecting the value that you return.
Loading more items...