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

Sign up
Appearance settings

Commit a68dc6c

Browse files
Create 1.py
1 parent e5d78f3 commit a68dc6c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎1-100/1.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution:
2+
def twoSum(self, nums, target):
3+
"""
4+
:type nums: List[int]
5+
:type target: int
6+
:rtype: List[int]
7+
"""
8+
length = len(nums)
9+
for i in range(length):
10+
for j in range(i + 1, length):
11+
if nums[i] + nums[j] == target:
12+
return [i, j]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /