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.
Java Fixed Test Sets Improvment.
Java sample test reports on STDERR:
./src/test/java/SolutionTest.java:11: error: cannot find symbol
assertTrue(Kata.fecolaast("chickadee","chote cake"));
^
symbol: method fecolaast(String,String)
location: class Kata
1 error
The C++ kata description says unsigned long. The max unsigned long number in C++ is about 10 digits, i.e. tests and control functions differ from problem description and it is a bug. Maybe the correct C++ description is unsigned long long, however the assert statements have to be updated in that case.
The test is not mine. It is a random generated test during attempt test phase and test numbers are reported by codewars. I simply copy/paste that test and both solutions, mine and ready made one from unlocked solutions report the 95 as a result?? At the same time the test says that the result must be 97?
Meanwhile, I unlock C++ solutions, and pass the same C++ test on my local PC with a a ready made unlocked solution and the result is 95 again, i.e. it is not 97 as a test states preliminary?!
More over I passed a JS solution with 106 green test (during attempt) of total 100 huge tests and the result is timeout, please write an eficient algorithm??
Why wrong?
I tested the same C++11 source code, however the results are not same???
This comment is hidden because it contains spoiler information about the solution
Yes, you are true. The bug is mine,
however the bigest C++ unsigned long is 4 294 967 295,
i.e about ten decimal digits,
and at the same time random test (during attempt)
passes me 12 digit numbers
such as
assert(solution({340445127495, 60921759657, 293857899522, 204267076497,
347612393337, 258021570312, 25085430447, 14334531684, 168430747287,
129010785156, 336861494574, 304608798285, 322526962890, 21501797526,
146928949761, 272356101996, 28669063368, 136178050998, 150512582682,
229352506944, 318943329969, 7167265842, 161263481445, 236519772786,
351196026258, 118259886393, 172014380208, 39419962131, 236519772786,
218601608181, 43003595052, 344028760416, 250854304470, 3583632921,
297441532443, 57338126736, 175598013129, 293857899522, 211434342339,
351196026258, 247270671549, 315359697048, 154096215603, 311776064127,
139761683919, 222185241102, 143345316840, 351196026258, 351196026258,
222185241102, 347612393337, 143345316840, 175598013129, 283107000759,
225768874023, 336861494574, 10750898763, 186348911892, 240103405707,
265188836154, 258021570312, 107508987630, 354779659179, 204267076497,
46587227973, 193516177734, 75256291341, 254437937391, 25085430447,
275939734917, 204267076497, 64505392578, 17918164605, 154096215603,
193516177734, 326110595811, 243687038628, 68089025499, 225768874023,
240103405707, 265188836154, 326110595811, 261605203233, 215017975260,
286690633680, 78839924262, 53754493815, 100341721788, 89590823025,
222185241102, 71672658420, 344028760416, 240103405707, 333277861653,
311776064127}) == 340445127495) ;
If you update "Smallest possible sum" description
from "if X[i] > X[j] then X[i] = X[i] - X[j]"
to "if X[j] > X[i] then X[j] = X[j] - X[i]"
then you can pass the first of BasicTests as follows:
"Assert::That(solution({1,21,55}), Equals(3));"
Please fix that bug.
Screen Locking Patterns is a very GOOD Kata!
Pretty solution :-)
Why not to update to myList.add(0, ...) and
to remove Collections.reverse(myList); ?
Clean solution + style :-)