


def 							__lowercase     (				__lowerCAmelCase							:       bytes     ):
							return "".join([hex(__lowerCAmelCase     )[2:].zfill(2     ).upper() for byte in list(__lowerCAmelCase     )]     )






def 							__lowercase     (				__lowerCAmelCase							:       str     ):
							# Check data validity, following RFC3548
							# https://www.ietf.org/rfc/rfc3548.txt
							if (len(__lowerCAmelCase     ) % 2) != 0:
														raise ValueError(
														    'Base16 encoded data is invalid:\nData does not have an even number of hex digits.'     )
							# Check the character set - the standard base16 alphabet
							# is uppercase according to RFC3548 section 6
							if not set(__lowerCAmelCase     ) <= set('0123456789ABCDEF'     ):
														raise ValueError(
														    'Base16 encoded data is invalid:\nData is not uppercase hex or it contains invalid characters.'     )
							# For every two hexadecimal digits (= a byte), turn it into an integer.
							# Then, string the result together into bytes, and return it.
							return bytes(int(data[i] + data[i + 1]      ,					1_6     ) for i in range(0      ,					len(__lowerCAmelCase     )      ,					2     )     )


if __name__ == "__main__":
						import doctest

						doctest.testmod()








from __future__ import annotations






def 							__lowercase     (				__lowerCAmelCase							:       list[int]     ):  # This function is recursive
							a__    =  len(__lowerCAmelCase     )
							# If the array contains only one element, we return it (it's the stop condition of
							# recursion)
							if array_length <= 1:
														return array
														# Else
							a__    =  array[0]
							a__    =  False
							a__    =  1
							a__    =  []
							while not is_found and i < array_length:
														if array[i] < pivot:
																					a__    =  True
																					a__    =  [element for element in array[i:] if element >= array[i]]
																					a__    =  longest_subsequence(__lowerCAmelCase     )
																					if len(__lowerCAmelCase     ) > len(__lowerCAmelCase     ):
																												a__    =  temp_array
														else:
																					i += 1

							a__    =  [element for element in array[1:] if element >= pivot]
							a__    =  [pivot, *longest_subsequence(__lowerCAmelCase     )]
							if len(__lowerCAmelCase     ) > len(__lowerCAmelCase     ):
														return temp_array
							else:
														return longest_subseq


if __name__ == "__main__":
						import doctest

						doctest.testmod()




