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.
never saw abs before) thanks
This solution is very clever and uses Swift's functional programming capabilities to create an elegant one-liner. However, it can be inefficient for large numbers as it creates an infinite sequence.The solutions employ bit manipulation techniques (user8436785 and Swagger1337) are more efficient and do not suffer from the performance hit associated with large numbers.
Hi there! Is is possible for you to explain this line of code in a bit more human way? I am still very new to Swift and I would like to understand what actually does this abs, reduce(1,*) :)) Thanks in advance for that!
@suic. Seems to be working now :-). Many thanks for the quick turnaround.
Thanks, it's fixed now. :) Sorry, it takes me time to develop a method which eliminates these issues while creating Haskell translations.
Regards,
suic
@suic @SteffenVogel - Thanks for looking into this. I am now getting a different error. It passes the 'Run Examples' still but fails on 'Attempt' with the following error:
/tmp/haskell1161118-18-1xmytx4.pq5qld6lxr/Main.hs:33:32:
Not in scope: `value'
Perhaps you meant value' (line 40)
/tmp/haskell1161118-18-1xmytx4.pq5qld6lxr/Main.hs:34:32:
Not in scope: `value'
Perhaps you meant value' (line 40)
/tmp/haskell1161118-18-1xmytx4.pq5qld6lxr/Main.hs:35:32:
Not in scope: `value'
Perhaps you meant value' (line 40)
/tmp/haskell1161118-18-1xmytx4.pq5qld6lxr/Main.hs:35:43:
Not in scope: `value'
Perhaps you meant value' (line 40)
Cheers,
Preston
@plspalding: Thanks, you're right. The reference implementation used in random tests was incomplete/incorrect. I've fixed it. Try now.
Regards, suic
Hey suic,
could you please review the issue from "plspalding" with this kata?
Thanks. :-)
@suic: Can you review this?
I am currently having a failure with a test case in Haskell:
Falsifiable (after 4 tests and 3 shrinks):
Nothing
Just "1"
From my understanding, I should be treating the Nothing as an empty string and the Just "1" as an empty string because it contains a character that isn't a letter. I have copied this code into a .hs file and ran the commands in ghci and my method returns True for this test.
So I do: compare' (Just "1") Nothing and get the answer True. From my understanding this is correct. However I am still getting a failure. Any help would be appreciated!