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.
The description is very old and poor. Translations should've modified the description, but no one did...
Still, for python it's quite obvious when you look at initial code and sample tests: it expects a regular function.
As for the failing test, did you see which input fails? See https://docs.codewars.com/training/troubleshooting/#print-input
This Kata doesn't have instructions specifically for Python and some cryptic description for Java. What do you want exactly?
I'm sure this is very clever to torture us with the single failing test, but if that's the game then why not make this a 7 or 6 kata? It's certainly not an 8.
uhh
It's a recursive solution. The condition checks to see if the string ends in an exclamation point. If it does, then the string gets the last character removed and it gets run through the
remove
function again. This way, the last exclamation point keeps getting removed.Finally, once all the recursive calls are made, the ternary will return the string without any exclamation points at the end.
I hope that makes sense, but if not, just know it's a recursive function and look up what that means and see some examples. Then it will make sense. Good luck!
Interesting problem. If I hadn't studied music I would not have been able to solve this. I agree with others that it should be explained clearer. It doesn't require too much music theory, just a little, for the average CW user to be able to figure this out.
Might be an enhancement later to have the coder solve how to differentiate between sharps and flats for the appropriate keys.
All that said, I enjoyed this problem. Bravo!
Looks like Haskell a bit
delete this
Looks good to me! Hope somebody with higher rank than me can approve this.
This comment is hidden because it contains spoiler information about the solution