func_code: def swap(a, i, j):
      tmp = a[j]
      a[j] = a[i]
      a[i] = tmp
  
  
  def sort(a):
      p = i
      j = i + 1
      while j < len(a):
          if a[j] < a[p]:
              p = j
              swap(a, i, j)
          j = j + 1
      return p