Skip to content

Commit dccc50a

Browse files
committed
onlybooks#32 Convert tuple of return value to list.
1 parent 6fc03fe commit dccc50a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

3-linear-data-structures/ch07/7-2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ def twoSum(self, nums: List[int], target: int) -> List[int]:
77
complement = target - n
88

99
if complement in nums[i + 1:]:
10-
return nums.index(n), nums[i + 1:].index(complement) + (i + 1)
10+
return [nums.index(n), nums[i + 1:].index(complement) + (i + 1)]

3-linear-data-structures/ch07/7-3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ def twoSum(self, nums: List[int], target: int) -> List[int]:
1111
# 타겟에서 첫 번째 수를 뺀 결과를 키로 조회
1212
for i, num in enumerate(nums):
1313
if target - num in nums_map and i != nums_map[target - num]:
14-
return nums.index(num), nums_map[target - num]
14+
return [nums.index(num), nums_map[target - num]]

3-linear-data-structures/ch07/7-5.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ def twoSum(self, nums: List[int], target: int) -> List[int]:
1212
elif nums[left] + nums[right] > target:
1313
right -= 1
1414
else:
15-
return left, right
15+
return [left, right]

0 commit comments

Comments
 (0)