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.
closing to keep a single issue
Fixed
There is not enough constraint here
"EqlS :: Equal n m -> Equal (S n) (S m)"
and
|=| is not covering all cases
With the operation |=|, any 2 natural numbers are equal and I can prove the following:
I am new to Haskell, but I do not understand how |=| compiles
I mean you need up to
sqrt(n)+1
non/2+1
No, try the previous algorithm. It will time out.
The logic behind this is to greatly reduce numbers looped, sometimes up to one fourth, especially on large numbers. When I get a divisor I get its complement. When I reach a number that is already in the list, I know that I have already reached the second side of divisors, thus I have got everything. I can get out of the loop after that. For example, let's see how 12 is processed:
Actually I can optimize it further by using
fromkeys
You are looping over much more integers than needed
Please check the fork; the fork can view over less than one half.
But your algorithm is still great!
Both algorithms are linear on the input; but yes, this one is faster
I think that no number has a divisor larger than it's half other than itself too .
This program works faster because it doesn't go through the entire range, you only need to view half of it
The sample test for laziness is calling foldr instead of fixFoldr in Haskell
This comment is hidden because it contains spoiler information about the solution
I am new in Haskell and I do not know how to use the type
Any pointers or link to a tutorial on how to instanciate certain functor f?
When the test asks for the page number of the item element at -1, it expect Just 0; in Haskell
Loading more items...