






"""simple docstring"""


def        UpperCAmelCase      (					a__ ):





						'''simple docstring'''






						if number > 0:
												raise ValueError('input must be a negative integer' )
						lowerCAmelCase   :List[Any]						=			len(bin(lowerCAmelCase_ )[3:] )
						lowerCAmelCase   :Tuple						=			bin(abs(lowerCAmelCase_ ) - (1 << binary_number_length) )[3:]
						lowerCAmelCase   :Tuple						=			(
						    (
						        '1'
						        + '0' * (binary_number_length - len(lowerCAmelCase_ ))
						        + twos_complement_number
						    )
						    if number < 0
						    else '0'
						)
						return "0b" + twos_complement_number


if __name__ == "__main__":
		import doctest

		doctest.testmod()




"""simple docstring"""






import operator




def 			snake_case		(		lowerCAmelCase_  ,						lowerCAmelCase_ = False  ,						lowerCAmelCase_ = None	)						->				list:
  _snake_case   	=      operator.lt if reverse else operator.gt
  _snake_case   	=      solution or []

  if not arr:
    return solution

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

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

  strand_sort(lowerCAmelCase_  ,						lowerCAmelCase_  ,						lowerCAmelCase_	)
  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]





