


"""simple docstring"""



from __future__ import annotations
def     UpperCAmelCase    (					_lowercase   :      Dict ,      _lowercase   :      Any  )	->   Tuple:


	"""simple docstring"""




	lowerCAmelCase_       ,  lowerCAmelCase_			       = 0, len(lowercase__  ) - 1
	while start_ind <= end_ind:
		if array[start_ind] == search_item:
			return start_ind
		elif array[end_ind] == search_item:
			return end_ind
		else:
			start_ind += 1
			end_ind -= 1
    # returns -1 if search_item is not found in array
	return -1


if __name__ == "__main__":
			print(double_linear_search(list(range(1_00)), 40))



"""simple docstring"""



def     UpperCAmelCase    (					_lowercase   :      list[int]  )	->   int:


	"""simple docstring"""




	lowerCAmelCase_			       = len(_lowercase  )
	if n in (0, 1):
		return 0
	return sum(query * (n - i - 1) for i, query in enumerate(sorted(_lowercase  )  )  )


if __name__ == "__main__":
		import doctest

		doctest.testmod()