






# Algorithm for the pigeonhole sorting








def     __lowercase					(    a :				Tuple )					->					int:
      __snake_case      :    List[str]  			=min(_lowerCAmelCase )  # min() finds the minimum value
      __snake_case      :    List[Any]  			=max(_lowerCAmelCase )  # max() finds the maximum value

      __snake_case      :    Union[str, Any]  			=max_val - min_val + 1  # size is difference of max and min values plus one

      # list of pigeonholes of size equal to the variable size
      __snake_case      :    List[Any]  			=[0] * size

      # Populate the pigeonholes.
      for x in a:
            assert isinstance(_lowerCAmelCase       ,		_lowerCAmelCase ), "integers only please"
            holes[x - min_val] += 1

      # Putting the elements back into the array in an order.
      __snake_case      :    Union[str, Any]  			=0
      for count in range(_lowerCAmelCase ):
            while holes[count] > 0:
                  holes[count] -= 1
                  __snake_case      :    Dict  			=count + min_val
                  i += 1



def     __lowercase					(    )					->					Optional[Any]:
      __snake_case      :    Optional[Any]  			=[8, 3, 2, 7, 4, 6, 8]
      pigeonhole_sort(_lowerCAmelCase )
      print('''Sorted order is:'''       ,		''' '''.join(_lowerCAmelCase ) )


if __name__ == "__main__":
    main()










"""simple docstring"""





def     __lowercase					(    a :				str       ,		a :				str )					->					str:
      __snake_case      :    int  			=len(a )
      __snake_case      :    int  			=len(a )
      __snake_case      :    int  			=(
          first_str_length if first_str_length > second_str_length else second_str_length
      )
      __snake_case      :    list  			=[]
      for char_count in range(a ):
            if char_count < first_str_length:
                  output_list.append(first_str[char_count] )
            if char_count < second_str_length:
                  output_list.append(second_str[char_count] )
      return "".join(a )


if __name__ == "__main__":
    print(alternative_string_arrange("""AB""", """XYZ"""), end=""" """)


