Back to course home
0% completed
Vote For New Content
Shorter solution, but O(n) space complexity
Nabeel Keblawi
Sep 4, 2024
I used only 2 lines of code, but it's O(n) space complexity not O(1) in the course solution. And it's also Python, which may not be doable in other languages.
tmp = ''.join([char for char in s if char.isalnum()]).lower() return tmp == tmp[::-1]
0
0
Comments
Comments
On this page