Skip to content

Commit b1811ee

Browse files
Added solutions
1 parent a1898c2 commit b1811ee

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

557.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Runtime: 28 ms, faster than 76.71% of Python online submissions for Reverse Words in a String III.
2+
# Difficulty: Easy
3+
4+
class Solution(object):
5+
def reverseWords(self, s):
6+
"""
7+
:type s: str
8+
:rtype: str
9+
"""
10+
return ' '.join(map(lambda word: word[::-1], s.split(' ')))

590.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Runtime: 112 ms, faster than 98.45% of Python online submissions for N-ary Tree Postorder Traversal.
2+
# Difficulty: Easy
3+
4+
class Solution(object):
5+
def postorder(self, root):
6+
"""
7+
:type root: Node
8+
:rtype: List[int]
9+
"""
10+
if not root:
11+
return []
12+
p_list = list()
13+
for child in root.children:
14+
p_list.extend(self.postorder(child))
15+
p_list.append(root.val)
16+
return p_list

627.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Runtime: 330 ms, faster than 35.42% of MySQL online submissions for Swap Salary.
2+
# Difficulty: Easy
3+
4+
UPDATE SALARY
5+
SET sex = IF(sex = 'f', 'm', 'f');

0 commit comments

Comments
 (0)