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.
This solution is forcing lowercase to account for the case-insensitive constraint. Also, your solution is being redundant by checking for a bool value to return a bool value.
Nice using of f string
I'm stupid xD
that is not a palindrome
This is best practices now, ignore comments on second solution with format as they are 5 years old.
There was a time where format was best practices, because many apps still didn't move to a higher python version. But Python 3.6 (first version where f strings released) is no longer supported both development and security wise.
f strings are quite the beauty.
This comment is hidden because it contains spoiler information about the solution
Can someone explain what is happening here? Glitch in the matrix?
Any other solution besides this is simply over-engineering.
cool!thinking from the concept of palindrome
This fails if s = "A man, a plan, a canal – Panama". This should be part of the acceptance.
This solution is O(N) in time. The "in-place" solution you are mentioning is O(N/2) which boils down to O(N) too, since 1/2 is just a constant factor.
The true difference between them lies in their space complexities. This one is O(N) in space, although it is simply mutating the input. But the "in-place" is O(1) in space because it does not use any auxiliary memory.
I still prefer this solution though, as you only need to user lower() once and it is very readable overall. Also, memory has become extremely cheap nowadays and it shouldn't be that much of a problem.
But this is not optimal solution in terms of BigO.
There is better "in-place" solution
i like it
Sexy
Loading more items...