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.
Just do what is fast in your particular language. Order of elements within a combination by definition does not matter.
I thought that give up meant I was supposed to use fold!
Haha, now that really sent me barking down the wrong alley...
We all did those
In retrospect, this was a pretty stupid way to approach the problem...
This comment is hidden because it contains spoiler information about the solution
Wait... I thought this was Fortran. I don't even know why. This is pretty embarrassing.
Oooh. Scala's pattern match-lambda (?) syntax looks neat.
This comment is hidden because it contains spoiler information about the solution
This is very pretty.
I could swear that I tried that...
Made me laugh!
What "creativity" are you talking about? This kata is super tight to allow only one solution for a good reason. In fact anything less tight will make it lose the point. If you're looking for "creativity" here, I'm afraid your princess is in another castle.
Kata best practice only says tests should be written so that a solution passes IIF it follows the requirement. It does not say a solution should pass if it is good enough. I know you don't like such katas (you don't like the
multi-line task
katas either, so...), but they exist for a good reason. Just move on, andgive up
like said in the description. You can't solve every kata on CW, and it's telling you to give up for exactly this reason. It's really your personal style issue and you should git gud instead.Resolving because it's not a suggestion.
I agree with JohanWiltink. IMO this is rather a "gimme-the-single-possible-solution-kata". "Golfing-with-restrictions" katas would be way more interesting and fun. Haskell is a perfect language for this type of katas with all the fancy operators and abstractions.
Ok, but even golfing katas should allow some variability/creativity either by relaxing the code length or by multiple possible shortest solutions.
Regards,
suic
I don't think I can, mainly because it's already approved and relaxing it will change the perceived difficulty a lot. (Looks like people think finding that exact solution is as easy as 6 or 7kyu already...)
Also, "forbid the obvious solution" isn't a very good option - golfing is an activity of throwing everything you can use into the code to make it shorter :)
Anyway, I guess I'll leave the suggestion open. Any improvement ideas are welcome.
This comment is hidden because it contains spoiler information about the solution
Loading more items...