Given an array of positive or negative integers I= [i1,..,in] you have to produce a sorted array P of the form ...
I must be composed of positive or negative integers and 1 is a positive integer so there is no problem in the input. The problem is in your "Actual" since you considered 1 as a prime factor of all elements of the input which is false since 1 is not a prime number (not being a prime number it can't be in this kata considered as a factor). Hence your "actual" is false and the correct answer is "Expect". Cheers.
I just tried the python version again and it's working perfectly fine.
I'm not really sure what you get as error here, but what's sure is that your code is effectively too slow: tests go up to 19 so with 9s up to 9 only, well... ;)
if the tests are interrupted without any feedback at the end, maybe it's related to an out of memory error (tho, this one generally leads to a totally empty feedback, so... I don't know).
run it again and look at the time, it may not be exactly the same... but then, realize this is a 1kyu kata, and again, I assure you the most likely reason you are not passing is because your code is simply not fast enough
The description says:
I
must be composed of positive or negative integers and1
is a positive integer so there is no problem in the input. The problem is in your "Actual" since you considered1
as a prime factor of all elements of the input which is false since1
is not a prime number (not being a prime number it can't be in this kata considered as a factor). Hence your "actual" is false and the correct answer is "Expect". Cheers.Hi,
I just tried the python version again and it's working perfectly fine.
I'm not really sure what you get as error here, but what's sure is that your code is effectively too slow: tests go up to 19 so with 9s up to 9 only, well... ;)
if the tests are interrupted without any feedback at the end, maybe it's related to an out of memory error (tho, this one generally leads to a totally empty feedback, so... I don't know).
In any case, this is not a kata issue.
cheers
run it again and look at the time, it may not be exactly the same... but then, realize this is a 1kyu kata, and again, I assure you the most likely reason you are not passing is because your code is simply not fast enough
every single kata will time out, so your code is probably not optimized enough to solve this kata