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 is great. This implements a lot of the ideas I had in my solution but does them in a much more logical place in the flow of the program. Makes it so easy to comprehend what is going on.
alr added
In stead of implementing
safeHead
yourself, you can uselistToMaybe
from Data.Maybe.I like your name better though.
Nice usage of list comprehension.
How is the solution supposed to work, exactly?
But that sequence isn't allowed, because one of the assumptions we've made is that if we're working with an application, and if a single value repeats, the whole sequence does. In your example, we have ,2,3, and ,2,1, which contradicts this.
Thank you very much! This particular submission actually is inspired from one of the interview questions I was given for the current job I'm working in. If it weren't for Codewars, I don't even think I would've gotten in! I'm glad to see that this platform is helping others just as much as it has helped me and that I can give back to the community.
Happy coding!
I think it would be best to clarify if an unwinnable state counts as a draw.
This might just have been the best Kata I have tried so far. It was, at least, the first one that challenged me past the naïve approach, and I even learned things I wouldn't have otherwise. Thank you for making this.