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.
For negative numbers, it works like Math.trunc(), I think.
Fixed.
because in the first case, A can not became to B, by swap at most 1 pair of elements.
second can: swap 1 and 2
Perhaps my 7kyu katas is harder than other 7kyu katas, sometimes ;-)
sort modified the input arrays
EDIT:
Amd, perhaps you misunderstood the task.
Your code will fail when two arrays have two or more pairs, which have the same value but different positions.
for example, [1,2,3,4] and [4,3,2,1]
Why should it be disabled?
It's mentioned in the description, but it actually isn't. This is confusing, but still better than the other way around -
"".match
is valid JS and I see absolutely no reason to disable it.For submit testing: have a handful of fixed tests with limited length inputs. Then test edge cases, fixed. Then test random inputs. In case there's a bug in the random generator or the reference solution, it helps to have some smaller random tests as well as larger ones ( where, if there's a problem, you drown in data ).
Erm, these look totally fine to me. What do you think is wrong with them?
It should be <= 25 seeing the tests cases. It only applies to javascript. I've used a conditional to only show it in javascript then.
@A.Partridge could you make all languages consistent? Or leave as it is, with the conditional comment. Now we know why all those issue reports.
done
except that 999912 = 612222049 where 2049 is neither a multiple of 2 nor 61, while 999424 = 61 * 2^14. So your code is just wrong, that's all.EDIT: ok, you're actually saying the same. But if you did taht, that is you misread the task. It's said in there (maybe a bit convoluted, but it's actually in there)
considering the primes are those two of the input. No?
What?? Though it is...
Watch out for floating point errors on loop iterations on this one. It's pretty subtle.
I consider this "issue" resolved.
Loading more items...