We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 80be243 commit 629ad80Copy full SHA for 629ad80
Reverse Words in a String.py
@@ -1,3 +1,3 @@
1
class Solution:
2
def reverseWords(self, s):
3
- return " ".join(filter(lambda x: x, reversed(s.split(" "))))
+ return " ".join(filter(None, reversed(s.split(" "))))
0 commit comments