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.
Why case b>2 should go to (a+1,1) rather than (a+1,2)?
Good idea!
Which is entirely correct.
This solution is great enough while the input i is an indeed Perfect Power, but if i is a random large number its efficiency will be at least O(sqrt(n)) which is terrible.
if !(b < 2) then b is either 1 or 2:
why check for b GT 2?
I also get out of memory failures.
I couldn't resolve it with
#!
nor with{-# LANGUAGE BangPatterns #-}
(I tried several combinations with both, it's possible I missed the correct one).Tests expect [[]] when inputting 0, but expect [] when inputting negative values or values greater than the length of the list.
Not a best pracitices for me, the name of first variable should not be named average, but sum... imho.