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.
How could this pass the test while my first try failed?
This should report an error with empty input of s2,
when you try scramble('r',''), this code return True while it should be False.
Thank you for your kindly reminding and reply. I figured it out eventually and passed the test.
I copy the code to my computer and works well:
My code test:
solution("apples, pears # and bananas\ngrapes\nbananas !apples",['#','!'])
'apples, pears\ngrapes\nbananas'
However, failed in here with the exactly same input arguments, which reported:
'apples, pears\ngrapes\nbananas !' should be 'apples, pears\ngrapes\nbananas'
Apparently, there exists an error caused this. Please check!