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.
well using list comprehension is more efficient as it only iterate through the characters one time but in this solution it iterate through the character 10 times, because .replace() iterate through the string in the background.
short isn't always better. if you can do it with one loop, it'll be more efficient. so far, smart.
O(2n). Not the best one
if the look up times in this solution are constant then it looks good to me
I think this code is much much, faster than the one liners, that are the top solutions for this kata, instead of going through each character in the string, it just does it for the whole string. Well done!
No, it is not. Check in my other solutions. There is a faster one.
5572ms when I submit, test cases work fine
Strictly speaking, since there are only two unique values (guaranteed by the description), set will have len 2, thus O(1) memory consumption.
maybe i'm wrong, but expressions a+bc and cb+a not make sense, how do you think?
great answer, can anybody tell me what is the use of 24 there?
Almost same programm bro
"Regexp Basics"
you are missing the point
In description:
This comment is hidden because it contains spoiler information about the solution
haha, I forgot to simplify it
Loading more items...