

import operator





def      A__					(			__A  :						str     ,				__A  :						int = False     ,				__A  :						Any = None			)					->List[Any]:
      __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]








'''simple docstring'''


def 						lowerCamelCase__   (				a							):
						assert (
						    isinstance(a    ,	a							) and number_of_steps > 0
						), f'number_of_steps needs to be positive integer, your input {number_of_steps}'
						if number_of_steps == 1:
												return 1
						__snake_case ,       __snake_case						 =   1, 1
						for _ in range(number_of_steps - 1							):
												__snake_case ,       __snake_case						 =   current + previous, current
						return current


if __name__ == "__main__":
	import doctest

	doctest.testmod()

