Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ca9e11d

Browse filesBrowse files
committed
add 561.py and 557.py
1 parent 20ef6d9 commit ca9e11d
Copy full SHA for ca9e11d

File tree

Expand file treeCollapse file tree

2 files changed

+21
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+21
-0
lines changed
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution(object):
2+
def reverseWords(self, s):
3+
"""
4+
:type s: str
5+
:rtype: str
6+
"""
7+
8+
l = map(lambda x: x[::-1], s.split(" "))
9+
return " ".join(l)
10+

‎py_solution/561. Array Partition I.py

Copy file name to clipboard
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution(object):
2+
def arrayPairSum(self, nums):
3+
"""
4+
:type nums: List[int]
5+
:rtype: int
6+
"""
7+
ret = 0
8+
9+
if nums:
10+
ret = sum(sorted(nums)[::2])
11+
return ret

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.