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.
This comment is hidden because it contains spoiler information about the solution
I have a question what will happen if n reaches 1 or 0?
Can it ever reach these cases?
I considered using recursion, but I later ended up with loop.
using recursion a great solution!!!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Nice job with Regex
a clever use of the -1 return, it took me a second to catch up
Clever. Not readable. Would not call this "best practice."
Excellent and elegant solution. I like a lot. Only if I can, just add an if to check that the array meets the condition of the 10 numbers, but it has been one of the answers that I liked the most.
You are simulating pattern matching. Read the #Performance note.
Every operation can be a right fold ( one fold per input list, interwoven if more than one ).
I am stuck with my solutions for some time. It is not performant enough to pass the tests. I have looked everywhere for guidance but Lambda Calculus implementation of this scale is rarely talked about. I tried testing solutions in chunks and what I found is when I don't include
zipWith
in the solutions, solutions are fast enough(around 5000ms) to get a result back from server and pass all the tests exceptzipWith
, but when I includezipWith
it's justExecution Timed Out
. I wonder whetherdrop
andtail
orhead
is the problem as I have to use them forzipWith
.aha! I was confused as to why the problem wanted you to return -1, now I can see that it sets you up for this solution...
Just clever!!
This comment is hidden because it contains spoiler information about the solution
Don't look at the type error - it's not helping in this case. You are misapplying types somewhere. Have a good look at what is a list and what is an element. ( It helps me to name lists
xs
instead ofl
. )Loading more items...