title: Problems on solving LeetCode #1 : got multiple values for an argument
body: <p>I'm trying to solve the #1 question in LeetCode, Two Sum, with bisection method. But I encountered an error, which said <code>got multiple values for argument \</code>array``. How can I solve this error ? And please tell me why it occurs, so next time I can avoid making the same mistake. Thanks ahead.</p>
  <p>The original question is as follows.</p>
  <p><a href="https://i.stack.imgur.com/00fLj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/00fLj.png" alt="LeetCode #1 Two Sum" /></a></p>
  <p>My codes are as follows.</p>
  <pre class="lang-py prettyprint-override"><code>#
  # @lc app=leetcode.cn id=1 lang=python3
  #
  # [1] 两数之和
  #
  # @lc code=start
  class Solution:
      def twoSum(self, nums: List[int], target: int) -&gt; List[int]:
  
          # Copy the original list and sort it, so I can get the index of answer from the original
          # list after I use a sorted list to find the answer.
          sorted_nums = nums.copy()
          sorted_nums.sort()
  
          # To find the answer.
          for i,v in enumerate(sorted_nums):
          
              remaining = target - v
              if self.bisection(
                  array=sorted_nums[i+1:], 
                  target=remaining):
  
                  # If the remaining is found in the rest of the list, 
                  # then end the for loop by returning the answer index.
                  return [nums.index(v), nums.index(remaining)]
      
      def bisection(self, array: List[int], target: int) -&gt; bool:
  
          if len(array) &lt; 1:
              return False
          # Only one element in array.
          # If it matches the target, return True.
          elif len(array) == 1:
              return (array[0] == target)
  
          # Multiple elements in array.
          # Determine the index of the median.
          if len(array) % 2 != 0:
              mid_index = len(array) // 2 + 1
          else:
              mid_index = len(array) // 2
          # If the median matches the target, return True.
          if array[mid_index] == target:
              return True
          # If the median is less than the target, use the right part of the array to locate the target.
          elif array[mid_index] &lt; target:
              return self.bisection(self, array = array[mid_index + 1:], target = target)
          # If more than the target, use the left part to locate the target.
          else:
              return self.bisection(self, array = array[: mid_index], target = target)
  # @lc code=end
  </code></pre>
  <p>The error message is as follows.</p>
  <pre><code>Line 44: TypeError: bisection() got multiple values for argument 'array'
  TypeError: bisection() got multiple values for argument 'array'
      return self.bisection(self, array = array[: mid_index], target = target)
  Line 44 in bisection (Solution.py)
      if self.bisection(
  Line 13 in twoSum (Solution.py)
      ret = Solution().twoSum(param_1, param_2)
  Line 70 in _driver (Solution.py)
      _driver()
  Line 81 in &lt;module&gt; (Solution.py)
  </code></pre>