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.
Thank you. I was about to skip this Kata. Until I saw your comment.
Thank you for pointing it out. You were right.
Turns out it was coming from somewhere else.
So frustrating. I'm doing Java.
What is the expected return value for
getPrimeFactorPotencies(long n)
withn = 0
?I'm returning
new Long[]{}
and test fails with null pointer exception.The line is 1,4,6,4,1.
Now build the sum with its squares.
1² + 4² + 6² + 4² + 1² = 70.
In case anyone is looking for Java's full implementation of
TreeNode
class. This will work:This riddle is just plain evil.
Thanks for this fun kata.
Especially liked how nice test outputs look.
Liked this one. Very interesting topic, teached me something new.
As others have already mentioned: Test cases would really help out. Also it is part of a series, which should be mentioned.
http://www.codewars.com/kata/genetic-algorithm-series-number-1-generate (Sadly none of them are available in java at this moment).
My tip to anyone doing the java version: Just don't.
What I stumbled upon:
Input words:
wqlq, mq, lb, , jt, e, fo, ej{, lhd, u
expected:
wqlq, mq, lb, [jt, e, fo, ej{, lhd and ]u
Now mysteriously
[
and]
characters appear out of nowhere?Can't be bothered with it.
There is a problem with method's return type.
Had to change the initial method from
to
for tests to pass.
Java test cases still have wrong syntax.
Use
When doing java version what is the expected result for
int n = 20
double[] signature = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}
?I'm returning
double[] arr = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}
(20 times '0')Getting ArrayIndexOutOfBoundsException at assertArrayEquals().
This is most likely a performance issue with the code.
Some tests will take pretty long strings.
Instead of string concat ( += ) try using StringBuilder.
Test cases for java are broken.
This can be fixed by simply renaming public class "Test"
to anything other than "Test".
Same issue
"Request failed with status code 500"
Loading more items...