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.
from billion variations i see solution without unrequired minmaxes (as well as mine).
in my opinion it is the best option
The spurious pattern laziness and the also spurious imports seem to be leftovers from an earlier version.
If you're refactoring anyway, change the tuple to a list ( the pattern matching will still work ) and do without
toList
.Of course, I was just commenting because for me, as a mathematician, it was on the first glance confusing that this actually works :D
To be fair, the type definition is Int -> Int, not (Num a) => a -> Int, so a Double would never be allowed into the function.
This comment is hidden because it contains spoiler information about the solution
Note that this definition would not work for Double, e.g. 2.25=1.5^2 would be sent to 2^2=4, because 1.5 gets rounded to 2, although 2.25 is closer to 1 than to 4.
Nice! So clean
It's not about size. In point-free version
cycle "10"
will most likely be evaluated only once (even if you don't really need it in this case)beautiful
This comment is hidden because it contains spoiler information about the solution
Well, you can fuse the map/reduce logic together into one reduce call if you prefer that way. I think it's more clear in this way, although less efficient.
You can simplify this a bit with
unsafeRegex
fromData.String.Regex.Unsafe
.Hey guys,
I've made a Purescript translation of this challenge, would anyone care to review it please? It's my first translation, so I'd be happy to take any feedback on board for future challenges.
It's not even a method, just a function.
If you are new to programming I guess it's recursion that confuses you in this example.
Notice the remove function in the body is the same one that's defined with the function keyword on line 1.
This comment is hidden because it contains spoiler information about the solution
Loading more items...