


'''simple docstring'''



from timeit import timeit







def     _UpperCamelCase      (		UpperCamelCase__					):
			if number < 0:
						raise ValueError("""the value of input must not be negative"""					)
			UpperCAmelCase__  :					List[Any]        =     0
			while number:
						number &= number - 1
						result += 1
			return result







def     _UpperCamelCase      (		UpperCamelCase__					):
			if number < 0:
						raise ValueError("""the value of input must not be negative"""					)
			UpperCAmelCase__  :					List[Any]        =     0
			while number:
						if number % 2 == 1:
									result += 1
						number >>= 1
			return result







def     _UpperCamelCase      (		):

			def do_benchmark(UpperCamelCase__					) -> None:
						UpperCAmelCase__  :					Any        =     """import __main__ as z"""
						print(f'''Benchmark when {number = }:'''					)
						print(f'''{get_set_bits_count_using_modulo_operator(UpperCamelCase__					) = }'''					)
						UpperCAmelCase__  :					Dict        =     timeit("""z.get_set_bits_count_using_modulo_operator(25)""" ,      setup=UpperCamelCase__					)
						print(f'''timeit() runs in {timing} seconds'''					)
						print(f'''{get_set_bits_count_using_brian_kernighans_algorithm(UpperCamelCase__					) = }'''					)
						UpperCAmelCase__  :					List[Any]        =     timeit(
						    """z.get_set_bits_count_using_brian_kernighans_algorithm(25)""" ,      setup=UpperCamelCase__ ,      )
						print(f'''timeit() runs in {timing} seconds'''					)

			for number in (2_5, 3_7, 5_8, 0):
						do_benchmark(UpperCamelCase__					)
						print()


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		benchmark()



'''simple docstring'''



def     _UpperCamelCase      (		UpperCamelCase__					):
			# if the collection is empty, returns empty
			if collection == []:
						return []

			# get some information about the collection
			UpperCAmelCase__  :					List[str]        =     len(UpperCamelCase__					)
			UpperCAmelCase__  :					Union[str, Any]        =     max(UpperCamelCase__					)
			UpperCAmelCase__  :					Optional[Any]        =     min(UpperCamelCase__					)

			# create the counting array
			UpperCAmelCase__  :					Dict        =     coll_max + 1 - coll_min
			UpperCAmelCase__  :					Optional[int]        =     [0] * counting_arr_length

			# count how much a number appears in the collection
			for number in collection:
						counting_arr[number - coll_min] += 1

			# sum each position with it's predecessors. now, counting_arr[i] tells
			# us how many elements <= i has in the collection
			for i in range(1 ,      UpperCamelCase__					):
						UpperCAmelCase__  :					List[str]        =     counting_arr[i] + counting_arr[i - 1]

			# create the output collection
			UpperCAmelCase__  :					Tuple        =     [0] * coll_len

			# place the elements in the output, respecting the original order (stable
			# sort) from end to begin, updating counting_arr
			for i in reversed(range(0 ,      UpperCamelCase__					)					):
						UpperCAmelCase__  :					Any        =     collection[i]
						counting_arr[collection[i] - coll_min] -= 1

			return ordered







def     _UpperCamelCase      (		UpperCamelCase__					):
			return "".join([chr(UpperCamelCase__					) for i in counting_sort([ord(UpperCamelCase__					) for c in string]					)]					)


if __name__ == "__main__":
		# Test string sort
		assert counting_sort_string('thisisthestring') == "eghhiiinrsssttt"

		__A	=input('Enter numbers separated by a comma:\n').strip()
		__A	=[int(item) for item in user_input.split(',')]
		print(counting_sort(unsorted))