Getting odds and evens swapped? Your list has 2,3,4,5,6 appearing odd number of times, the kata states there will be exactly one that appears an odd number of times. And yes, this trick only works if the input follows the rule.
Haskell, right? So it's not as straight-forward as just "printing" because we're outside IO, we have to resort to unsafePerformIO .. but there exists a module to help us out a bit. Example:
moduleCodewars.Kata.ComparewhereimportDebug.Tracecomp:: [Integer] -> [Integer] ->Boolcompasbs=traceShow (as, bs) $as==bs-- without trace:-- comp as bs = as == bs
This comment is hidden because it contains spoiler information about the solution
Getting odds and evens swapped? Your list has 2,3,4,5,6 appearing odd number of times, the kata states there will be exactly one that appears an odd number of times. And yes, this trick only works if the input follows the rule.
Haskell, right? So it's not as straight-forward as just "printing" because we're outside IO, we have to resort to
unsafePerformIO
.. but there exists a module to help us out a bit. Example:You can check it yourself: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution#how-can-i-see-which-input-causes-my-solution-to-fail