prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add Python type hints and doctests to other/two_sum.py
  @tonydelanuez Would you be willing to add Python type hints and doctests to [`other/two_sum.py`](../blob/master/other/two_sum.py)?  The function comments say that it will return a `list[int]` but instead it either returns a `list[list[int]]` or `False`.
  
  </issue>
  <code>
  [start of other/two_sum.py]
  1 """
  2 Given an array of integers, return indices of the two numbers such that they add up to
  3 a specific target.
  4 
  5 You may assume that each input would have exactly one solution, and you may not use the
  6 same element twice.
  7 
  8 Example:
  9 Given nums = [2, 7, 11, 15], target = 9,
  10 
  11 Because nums[0] + nums[1] = 2 + 7 = 9,
  12 return [0, 1].
  13 """
  14 
  15 
  16 def twoSum(nums, target):
  17     """
  18     :type nums: List[int]
  19     :type target: int
  20     :rtype: List[int]
  21     """
  22     chk_map = {}
  23     for index, val in enumerate(nums):
  24         compl = target - val
  25         if compl in chk_map:
  26             indices = [chk_map[compl], index]
  27             print(indices)
  28             return [indices]
  29         else:
  30             chk_map[val] = index
  31     return False
  32
  [end of other/two_sum.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/other/two_sum.py b/other/two_sum.py
  --- a/other/two_sum.py
  +++ b/other/two_sum.py
  @@ -11,21 +11,37 @@
   Because nums[0] + nums[1] = 2 + 7 = 9,
   return [0, 1].
   """
  +from __future__ import annotations
   
   
  -def twoSum(nums, target):
  +def two_sum(nums: list[int], target: int) -> list[int]:
       """
  -    :type nums: List[int]
  -    :type target: int
  -    :rtype: List[int]
  +    >>> two_sum([2, 7, 11, 15], 9)
  +    [0, 1]
  +    >>> two_sum([15, 2, 11, 7], 13)
  +    [1, 2]
  +    >>> two_sum([2, 7, 11, 15], 17)
  +    [0, 3]
  +    >>> two_sum([7, 15, 11, 2], 18)
  +    [0, 2]
  +    >>> two_sum([2, 7, 11, 15], 26)
  +    [2, 3]
  +    >>> two_sum([2, 7, 11, 15], 8)
  +    []
  +    >>> two_sum([3 * i for i in range(10)], 19)
  +    []
       """
       chk_map = {}
       for index, val in enumerate(nums):
           compl = target - val
           if compl in chk_map:
  -            indices = [chk_map[compl], index]
  -            print(indices)
  -            return [indices]
  -        else:
  -            chk_map[val] = index
  -    return False
  +            return [chk_map[compl], index]
  +        chk_map[val] = index
  +    return []
  +
  +
  +if __name__ == "__main__":
  +    import doctest
  +
  +    doctest.testmod()
  +    print(f"{two_sum([2, 7, 11, 15], 9) = }")
  
verification_info: {"golden_diff": "diff --git a/other/two_sum.py b/other/two_sum.py\n--- a/other/two_sum.py\n+++ b/other/two_sum.py\n@@ -11,21 +11,37 @@\n Because nums[0] + nums[1] = 2 + 7 = 9,\n return [0, 1].\n \"\"\"\n+from __future__ import annotations\n \n \n-def twoSum(nums, target):\n+def two_sum(nums: list[int], target: int) -> list[int]:\n     \"\"\"\n-    :type nums: List[int]\n-    :type target: int\n-    :rtype: List[int]\n+    >>> two_sum([2, 7, 11, 15], 9)\n+    [0, 1]\n+    >>> two_sum([15, 2, 11, 7], 13)\n+    [1, 2]\n+    >>> two_sum([2, 7, 11, 15], 17)\n+    [0, 3]\n+    >>> two_sum([7, 15, 11, 2], 18)\n+    [0, 2]\n+    >>> two_sum([2, 7, 11, 15], 26)\n+    [2, 3]\n+    >>> two_sum([2, 7, 11, 15], 8)\n+    []\n+    >>> two_sum([3 * i for i in range(10)], 19)\n+    []\n     \"\"\"\n     chk_map = {}\n     for index, val in enumerate(nums):\n         compl = target - val\n         if compl in chk_map:\n-            indices = [chk_map[compl], index]\n-            print(indices)\n-            return [indices]\n-        else:\n-            chk_map[val] = index\n-    return False\n+            return [chk_map[compl], index]\n+        chk_map[val] = index\n+    return []\n+\n+\n+if __name__ == \"__main__\":\n+    import doctest\n+\n+    doctest.testmod()\n+    print(f\"{two_sum([2, 7, 11, 15], 9) = }\")\n", "issue": "Add Python type hints and doctests to other/two_sum.py\n@tonydelanuez Would you be willing to add Python type hints and doctests to [`other/two_sum.py`](../blob/master/other/two_sum.py)?  The function comments say that it will return a `list[int]` but instead it either returns a `list[list[int]]` or `False`.\n", "before_files": [{"content": "\"\"\"\nGiven an array of integers, return indices of the two numbers such that they add up to\na specific target.\n\nYou may assume that each input would have exactly one solution, and you may not use the\nsame element twice.\n\nExample:\nGiven nums = [2, 7, 11, 15], target = 9,\n\nBecause nums[0] + nums[1] = 2 + 7 = 9,\nreturn [0, 1].\n\"\"\"\n\n\ndef twoSum(nums, target):\n    \"\"\"\n    :type nums: List[int]\n    :type target: int\n    :rtype: List[int]\n    \"\"\"\n    chk_map = {}\n    for index, val in enumerate(nums):\n        compl = target - val\n        if compl in chk_map:\n            indices = [chk_map[compl], index]\n            print(indices)\n            return [indices]\n        else:\n            chk_map[val] = index\n    return False\n", "path": "other/two_sum.py"}]}