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.
Think it should be log(n)
This comment is hidden because it contains spoiler information about the solution
Why does the if statement not break the loop and return s when it encounters first alphanumeric char?
for char in s[::-1]:
if char.isalpha():
return s
elif char == "!":
s = s.replace(char,"")
return s
This comment is hidden because it contains spoiler information about the solution
Didn't know we could specify another value when typecasting to int if the first one raises an error. Very cool trick!