from __future__ import annotations

def      SCREAMING_SNAKE_CASE_  (		snake_case__							)  ->			list[int]:
							if not list_of_ints:
														return []

							if min(snake_case__							) < 0:
														raise ValueError('''All numbers must be positive'''							)

							lowerCAmelCase				=	max(len(bin(snake_case__							)[2:]							) for x in list_of_ints							)
							return _msd_radix_sort(snake_case__     ,						snake_case__							)

def      SCREAMING_SNAKE_CASE_  (		snake_case__     ,						snake_case__							)  ->			list[int]:
							if bit_position == 0 or len(snake_case__							) in [0, 1]:
														return list_of_ints

							lowerCAmelCase				=	[]
							lowerCAmelCase				=	[]
							# Split numbers based on bit at bit_position from the right
							for number in list_of_ints:
														if (number >> (bit_position - 1)) & 1:
																					# number has a one at bit bit_position
																					ones.append(snake_case__							)
														else:
																					# number has a zero at bit bit_position
																					zeros.append(snake_case__							)

    # recursively split both lists further
							lowerCAmelCase				=	_msd_radix_sort(snake_case__     ,						bit_position - 1							)
							lowerCAmelCase				=	_msd_radix_sort(snake_case__     ,						bit_position - 1							)

							# recombine lists
							lowerCAmelCase				=	zeros
							res.extend(snake_case__							)

							return res

def      SCREAMING_SNAKE_CASE_  (		snake_case__							)  ->			Any:
							lowerCAmelCase				=	len(snake_case__							)
							if not list_of_ints or length == 1:
														return

							if min(snake_case__							) < 0:
														raise ValueError('''All numbers must be positive'''							)

							lowerCAmelCase				=	max(len(bin(snake_case__							)[2:]							) for x in list_of_ints							)
							_msd_radix_sort_inplace(snake_case__     ,						snake_case__     ,						0     ,						snake_case__							)

def      SCREAMING_SNAKE_CASE_  (		snake_case__     ,						snake_case__     ,						snake_case__     ,						snake_case__							)  ->			Dict:
							if bit_position == 0 or end_index - begin_index <= 1:
														return

							bit_position -= 1

							lowerCAmelCase				=	begin_index
							lowerCAmelCase				=	end_index - 1
							while i <= j:
														lowerCAmelCase				=	False
														if not (list_of_ints[i] >> bit_position) & 1:
																					# found zero at the beginning
																					i += 1
																					lowerCAmelCase				=	True
														if (list_of_ints[j] >> bit_position) & 1:
																					# found one at the end
																					j -= 1
																					lowerCAmelCase				=	True

														if changed:
																					continue

														lowerCAmelCase	,   lowerCAmelCase				=	list_of_ints[j], list_of_ints[i]
														j -= 1
														if j != i:
																					i += 1

							_msd_radix_sort_inplace(snake_case__     ,						snake_case__     ,						snake_case__     ,						snake_case__							)
							_msd_radix_sort_inplace(snake_case__     ,						snake_case__     ,						snake_case__     ,						snake_case__							)


if __name__ == "__main__":
	import doctest

	doctest.testmod()




def      SCREAMING_SNAKE_CASE_  (		snake_case__     ,						snake_case__							)  ->			int:
							return (input_a, input_a).count(0							) % 2

def      SCREAMING_SNAKE_CASE_  (		)  ->			None:
							assert xor_gate(0     ,						0							) == 0
							assert xor_gate(0     ,						1							) == 1
							assert xor_gate(1     ,						0							) == 1
							assert xor_gate(1     ,						1							) == 0


if __name__ == "__main__":
	print(xor_gate(0, 0))
	print(xor_gate(0, 1))



