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 mind - set comprehension! Duh!
how does this pass the test case where there is a duplicate in the input list? I don't see how this comprehension eliminates repeating elements...
eg:
a1 = ['a','a',b']
a2 = ['ha', 'ba']
why is the output NOT ['a','a','b']?
I see that almost all the solutions are Regex based. I have heard that regex should be avoided unless there is a very strong reason to use it. Here, the regex is simple and quite easy to get right but I'm wondering why we WOULD or WOULD_NOT choose a regex in the wild
The input may have 0's in unexpected places - try making the ranges 0-9 and see if that is the issue...
Good point - I had not conisdered the "N times" instruction. That would be very hard to accomplish with a zero lenght string!
I see this failing for a zero length string so this not be one of the test cases. Fix it simply...
return str if len(str) <= 1 else str[-1]+reverse(str[:-1])