


def 							lowerCAmelCase_	(   __lowerCamelCase      ):
							__snake_case						:     int									=  abs(__lowerCamelCase      )
							__snake_case						:     Dict									=  0
							while n > 0:
														res += n % 1_0
														n //= 1_0
							return res







def 							lowerCAmelCase_	(   __lowerCamelCase      ):
							__snake_case						:     Union[str, Any]									=  abs(__lowerCamelCase      )
							return n if n < 1_0 else n % 1_0 + sum_of_digits(n // 1_0      )







def 							lowerCAmelCase_	(   __lowerCamelCase      ):
							return sum(int(__lowerCamelCase      ) for c in str(abs(__lowerCamelCase      )      )      )







def 							lowerCAmelCase_	(   ):
							from collections.abc import Callable
							from timeit import timeit

							def benchmark_a_function(__lowerCamelCase				,      __lowerCamelCase      ) -> None:
														__snake_case						:     Optional[Any]									=  F'{func.__name__}({value})'
														__snake_case						:     List[str]									=  timeit(F'__main__.{call}'				,      setup="import __main__"      )
														print(F'{call:56} = {func(__lowerCamelCase      )} -- {timing:.4f} seconds'      )

							for value in (2_6_2_1_4_4, 1_1_2_5_8_9_9_9_0_6_8_4_2_6_2_4, 1_2_6_7_6_5_0_6_0_0_2_2_8_2_2_9_4_0_1_4_9_6_7_0_3_2_0_5_3_7_6):
														for func in (sum_of_digits, sum_of_digits_recursion, sum_of_digits_compact):
																					benchmark_a_function(__lowerCamelCase				,      __lowerCamelCase      )
														print()


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			benchmark()



"""simple docstring"""





import operator
def 				A_  (__a					, __a = False					, __a = None					):

					'''simple docstring'''





					A_								=    operator.lt if reverse else operator.gt
					A_								=    solution or []

					if not arr:
										return solution

					A_								=    [arr.pop(0					)]
					for i, item in enumerate(__a					):
										if _operator(__a					, sublist[-1]					):
															sublist.append(__a					)
															arr.pop(__a					)

    #  merging sublist into solution list
					if not solution:
										solution.extend(__a					)
					else:
										while sublist:
															A_								=    sublist.pop(0					)
															for i, xx in enumerate(__a					):
																				if not _operator(__a					, __a					):
																									solution.insert(__a					, __a					)
																									break
															else:
																				solution.append(__a					)

					strand_sort(__a					, __a					, __a					)
					return solution


if __name__ == "__main__":
		assert strand_sort([4, 3, 5, 1, 2]) == [1, 2, 3, 4, 5]
		assert strand_sort([4, 3, 5, 1, 2], reverse=True) == [5, 4, 3, 2, 1]




