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.
Agreed, I modified tests to check the Euclidean division property.
Fixed. I also copied the expected property of Euclidean division to Example Test Cases.
Agreed. I removed all properties of
abs
andsignum
exceptabs z * signum z == z
, because this one is the requirement of Haskell Report.Valid point, thanks, I'll take a look.
While
abs
andsignum
does not make much sense mathematically,Num
interface still requires them to be defined. Yes, there is more than one way to do it, but the description clearly lists all expected properties, so I do not agree that this part of the problem is ill-defined.I know very well that such algorithm exists :)
Generating longer tests does not help to distinguish a constant-time and a linear-time algorithms, because Codewars platform has a pretty long timeout (6000 ms IIRC) and linear solutions will still pass. Generating really HUGE test data may work, but it is easy to misjudge the size, triggering timeout during generating inputs.
What kind of tests are you proposing? It is possible to distinguish between linear and quadratic solutions, passing sufficiently large inputs for quadratic one to time out. But distinguishing constant-time and linear, especially in C++?.. It can easily digest whole RAM before timeout.
Why would 0^1 be equal to 1?
What kind of help are you asking for?
Print inputs to console, this way you would be able to log all tests, including random.
Should be better now, thanks for reporting.
Done, thanks for suggestion.
Approved :)
This comment is hidden because it contains spoiler information about the solution
Why should it be 9?
Loading more items...