






import operator




def      lowercase__      (     __snake_case    :							list     ,       __snake_case    :							bool = False     ,       __snake_case    :							list | None = None  ):


					'''simple docstring'''


					UpperCAmelCase_    :      Dict            =						operator.lt if reverse else operator.gt
					UpperCAmelCase_    :      Optional[Any]            =						solution or []

					if not arr:
										return solution

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

    #  merging sublist into solution list
					if not solution:
										solution.extend(__snake_case  )
					else:
										while sublist:
															UpperCAmelCase_    :      Optional[Any]            =						sublist.pop(0  )
															for i, xx in enumerate(__snake_case  ):
																				if not _operator(__snake_case     ,       __snake_case  ):
																									solution.insert(__snake_case     ,       __snake_case  )
																									break
															else:
																				solution.append(__snake_case  )

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














def      lowercase__      (     __snake_case    :							int     ,       __snake_case    :							int  ):


					'''simple docstring'''


					if a < 0 or b < 0:
										raise ValueError('the value of both inputs must be positive'  )

					UpperCAmelCase_    :      Tuple            =						str(bin(__snake_case  )  )[2:]  # remove the leading "0b"
					UpperCAmelCase_    :      Union[str, Any]            =						str(bin(__snake_case  )  )[2:]  # remove the leading "0b"

					UpperCAmelCase_    :      List[Any]            =						max(len(__snake_case  )     ,       len(__snake_case  )  )

					return "0b" + "".join(
					    str(int(char_a == '1' and char_b == '1'  )  )
					    for char_a, char_b in zip(a_binary.zfill(__snake_case  )     ,       b_binary.zfill(__snake_case  )  )  )


if __name__ == "__main__":
		import doctest

		doctest.testmod()






