






from string import ascii_uppercase







def 						_UpperCamelCase (     UpperCamelCase_							:       str     ,							UpperCamelCase_							:       str     ,							UpperCamelCase_							:       bool = False     ,							UpperCamelCase_							:       str = ascii_uppercase		)	-> str:

						"""simple docstring"""



						lowerCAmelCase__         =    keyword.upper()
						lowerCAmelCase__         =    plaintext.upper()
						lowerCAmelCase__         =    set(UpperCamelCase_		)

						# create a list of unique characters in the keyword - their order matters
						# it determines how we will map plaintext characters to the ciphertext
						lowerCAmelCase__         =    []
						for char in keyword:
												if char in alphabet_set and char not in unique_chars:
																		unique_chars.append(UpperCamelCase_		)
    # the number of those unique characters will determine the number of rows
						lowerCAmelCase__         =    len(UpperCamelCase_		)

						# create a shifted version of the alphabet
						lowerCAmelCase__         =    unique_chars + [
						    char for char in alphabet if char not in unique_chars
						]

						# create a modified alphabet by splitting the shifted alphabet into rows
						lowerCAmelCase__         =    [
						    shifted_alphabet[k : k + num_unique_chars_in_keyword]
						    for k in range(0     ,							26     ,							UpperCamelCase_		)
						]

						# map the alphabet characters to the modified alphabet characters
						# going 'vertically' through the modified alphabet - consider columns first
						lowerCAmelCase__         =    {}
						lowerCAmelCase__         =    0
						for column in range(UpperCamelCase_		):
												for row in modified_alphabet:
																		# if current row (the last one) is too short, break out of loop
																		if len(UpperCamelCase_		) <= column:
																								break

																		# map current letter to letter in modified alphabet
																		lowerCAmelCase__         =    row[column]
																		letter_index += 1

						if verbose:
												print(UpperCamelCase_		)
						# create the encrypted text by mapping the plaintext to the modified alphabet
						return "".join(mapping[char] if char in mapping else char for char in plaintext		)


if __name__ == "__main__":
					# example use
					print(mixed_keyword("""college""", """UNIVERSITY"""))













from __future__ import annotations







def 						_UpperCamelCase (     UpperCamelCase_							:       list[int]		)	-> list[int]:

						"""simple docstring"""



						if not list_of_ints:
												return []

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

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







def 						_UpperCamelCase (     UpperCamelCase_							:       list[int]     ,							UpperCamelCase_							:       int		)	-> list[int]:

						"""simple docstring"""



						if bit_position == 0 or len(UpperCamelCase_		) 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(UpperCamelCase_		)
												else:
																		# number has a zero at bit bit_position
																		zeros.append(UpperCamelCase_		)

    # recursively split both lists further
						lowerCAmelCase__         =    _msd_radix_sort(UpperCamelCase_     ,							bit_position - 1		)
						lowerCAmelCase__         =    _msd_radix_sort(UpperCamelCase_     ,							bit_position - 1		)

						# recombine lists
						lowerCAmelCase__         =    zeros
						res.extend(UpperCamelCase_		)

						return res







def 						_UpperCamelCase (     UpperCamelCase_							:       list[int]		)	-> Any:

						"""simple docstring"""



						lowerCAmelCase__         =    len(UpperCamelCase_		)
						if not list_of_ints or length == 1:
												return

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

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







def 						_UpperCamelCase (     UpperCamelCase_							:       list[int]     ,							UpperCamelCase_							:       int     ,							UpperCamelCase_							:       int     ,							UpperCamelCase_							:       int		)	-> int:

						"""simple docstring"""



						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(UpperCamelCase_     ,							UpperCamelCase_     ,							UpperCamelCase_     ,							UpperCamelCase_		)
						_msd_radix_sort_inplace(UpperCamelCase_     ,							UpperCamelCase_     ,							UpperCamelCase_     ,							UpperCamelCase_		)


if __name__ == "__main__":
					import doctest

					doctest.testmod()





