"Write a function that returns the number of occurrences of an element in an array."
If the element is an "a" and there is an element "aba" in the array it should say in the description not to count letters there. It is unclear.
Initial code says sortArray :: [a] -> [Int] -> [a]. Some solutions expand this to (Ord a) => sortArray :: [a] -> [Int] -> [a]. This should be tested against.
They're clearly two different elements.
Corrected.
"Write a function that returns the number of occurrences of an element in an array."
If the element is an "a" and there is an element "aba" in the array it should say in the description not to count letters there. It is unclear.
Write a functionthat returns the number of occurrences of an element in an array. "functionthat" muse be devided into "function" and "that".
JavaScript and CoffeeScript too.
Thx for helping add CFML translations! :)
No random tests in Python.
Prolog and CFML translations kumited. (author inactive)
( Haskell )
Initial code says
sortArray :: [a] -> [Int] -> [a]
. Some solutions expand this to(Ord a) => sortArray :: [a] -> [Int] -> [a]
. This should be tested against.Also, no random tests.
I'd fix it, but I can't.
Thank you. The kata wasn't as straightforward as I thought at first glance.
The first element in the result array should be the element that has 0 in the same position in the sortingArray and so on. You are not far
This comment is hidden because it contains spoiler information about the solution
Approved ;-)
Thanks, did not know about Test.randomize and I changed the random test so it can not be cheated.
Loading more items...