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 is becuase n squared is equal to 144. The sum of 1, 2, 3, 7, 9 all squared gives that solution but 1, 2, 4, 11 does not. It equals 142.
This comment is hidden because it contains spoiler information about the solution
:-)
Thank you very much for your help! I found a typo in my code.
OK. Please be aware that the Random test output my expected values.
For example, the test 5 is saying dogYears=
14
means owned for humanYears=0
([1,0]
the 2nd element - e.g. array index 1 is0
), but your solution returned1
And that is the correct result (14dy -> 0hy) because Kata description says
Results are truncated ...
So your solution is incorrect.
Random test 1: catYears=75, dogYears=16 => [14, 1]
Random test 2: catYears=54, dogYears=54 => [9, 8]
Random test 3: catYears=23, dogYears=94 => [1, 16]
Random test 4: catYears=99, dogYears=74 => [20, 12]
Random test 5: catYears=15, dogYears=14 => [1, 0]
arrays first differed at element [1]; expected:< 0> but was:< 1>
In first message I also use copy-paste, but delete tests where there is no 1 at element < 1>
Please cut/paste the console log of your failing random test instead of re-typing it. I don't quite trust what I am looking at...
e.g.
Java
It seems he only coded in Java so far.
Which language?
All is correct, but the compiler produces this error.
Arrays first differed at element [1]; expected: 0 but was: 1
Random test 4: catYears=7, dogYears=22 => [0, 1]
Random test 20: catYears=100, dogYears=15 => [21, 1]
Random test 67: catYears=61, dogYears=21 => [11, 1]
But 22 -> 1 year
15 -> 1 year
21 -> 1 year
I think it's all about input data, not a program itself.