Agreed, I first solved it in Python and while I am fluent with most of the string methods after years of Python, I had forgotten about this one in absence of practice and solved it with less advanced features and alorithmic logic. Built-in methods are just masked hardwork of creators, and they can indeed be less efficient in cases and you would needa use your own logic!
DAMN
This comment is hidden because it contains spoiler information about the solution
I'll say.
I just happened to see some examples of how this function worked yesterday otherwise my code would've been a lot longer im sure 😅
This comment is hidden because it contains spoiler information about the solution
Haha, same
Same. I also overcomplicated it
Mutating an argument is the worst thing you can do.
Agreed, I first solved it in Python and while I am fluent with most of the string methods after years of Python, I had forgotten about this one in absence of practice and solved it with less advanced features and alorithmic logic. Built-in methods are just masked hardwork of creators, and they can indeed be less efficient in cases and you would needa use your own logic!
Damn it! lmao I didn't know that method exists, Nice!! I'm going to add this to my future references thank you very much!
This comment is hidden because it contains spoiler information about the solution
To make myself feel better I'd say, those of us who actually wrote an algorithm are geniuses too, instead of using built-in functions. :P
RIGHT!!! I thought I had finally found the most basic way to the solution with a ternary operator. But that good ole 'truthy' statement....lol
Wow, how can I forget something so basic... And here I thought using RegEx was being clever of me 😂
This comment is hidden because it contains spoiler information about the solution
Loading more items...