Update README.md
Browse filesUpdated formatting.
README.md
CHANGED
@@ -215,13 +215,13 @@ Only one valid answer exists.
|
|
215 |
Certainly, here is one potential way to implement a function in Python 3 that effectively solves the problem.
|
216 |
'''python
|
217 |
class Solution:
|
218 |
-
def twoSum(self, A: List[int], T: int) -> List[int]:
|
219 |
-
ans = []
|
220 |
-
for x in range(len(A)-1):
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
return ans
|
226 |
'''
|
227 |
```
|
|
|
215 |
Certainly, here is one potential way to implement a function in Python 3 that effectively solves the problem.
|
216 |
'''python
|
217 |
class Solution:
|
218 |
+
def twoSum(self, A: List[int], T: int) -> List[int]:
|
219 |
+
ans = []
|
220 |
+
for x in range(len(A)-1):
|
221 |
+
if A[x]+A[x+1] == T:
|
222 |
+
ans.append(x)
|
223 |
+
else:
|
224 |
+
ans.append(x+1)
|
225 |
+
return ans
|
226 |
'''
|
227 |
```
|