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.
I'm sorry but maybe your algorithm is not efficient enough. There are amongst others four tests with 9 digits numbers. It's cheating but in Ruby you can try to use the 'Prime' class (I don't use it and my solution takes 500 ms), you'll be less disappointed...
My problem still persists. I'm using Ruby and when I click on "Run Tests" the one test passes:
Test Passed: Value == "(22)(33)(5)(7)(11**2)(17)"
1 Passed
0 Failed
0 Errors
Process took 63ms to complete
But when I hit cmd+enter or "Submit", I get:
Process was terminated. It took longer than 6000ms to complete
0 Passed
0 Failed
0 Errors
It's not a huge deal, I know I solved the problem and that's what matters, but I kind of want my points too :)
My bad, I made a small blunder and it didn't work for multiples di 19, sorry.
Now it is fixed and it should work just fine :)
I think Giacomo will respond for the JS translation.
Your test case solution is not correct: for the number 19779, it doesn't factorize 6593 into 19 * 347
It should work for random inputs too - Expected: (3)(6593), instead got: (3)(19)(347)
I had to submit a few times to get my solution to pass.
I hope it is and thanks for taking your time answering that issue :)
I didn't see the comment.
I answered @xvlcwk saying "no test are random but there are 18 tests and among these 18 tests they are randomly chosen so you don't always have the same tests." Is that clear enough?
My pleasure, as working with your katas is always challenging and fun :)
P.S.: not sure if you saw a comment here, but we got an user asking if all the test cases of your translation in C# were random, so feel free to answer as you see fit :)
Another problem is that we all get a given time for every language, with no chance to set it up, so in some languages a kata may be tougher; if you tried my JS version, I warn you that solving it in the given time is surely harder than using Python or Ruby (I tried using the same exact code, but it took too much, so I pulled out a trick or two out of my neophyte hat).
Is your language Clojure? There are some relatively big numbers but not a lot of tests so I don't think that your solution is too slow. Unfortunately Codewars has, too often IMHO, problems and times out or gives weird errors when it is too busy... Try later and tell me if you eventually succeeed or not.
This comment is hidden because it contains spoiler information about the solution