'''simple docstring'''

from collections import deque

from .hash_table import HashTable


class 				_lowercase	(      lowerCAmelCase   ):
      '''simple docstring'''


      def __init__(				self					,*lowerCamelCase_					,**lowerCamelCase_							)			->			Dict:



         '''simple docstring'''



         super().__init__(*__a					,**__a							)




      def 		lowerCAmelCase__					(				self					,lowerCamelCase_					,lowerCamelCase_							)			->			str:



         '''simple docstring'''



         UpperCAmelCase__							:				Any   				=  deque([]							) if self.values[key] is None else self.values[key]
         self.values[key].appendleft(__a							)
         UpperCAmelCase__							:				Any   				=  self.values[key]




      def 		lowerCAmelCase__					(				self							)			->			Tuple:



         '''simple docstring'''



         return (
             sum(self.charge_factor - len(__a							) for slot in self.values							)
             / self.size_table
             * self.charge_factor
         )




      def 		lowerCAmelCase__					(				self					,lowerCamelCase_					,lowerCamelCase_=None							)			->			List[str]:



         '''simple docstring'''



         if not (
             len(self.values[key]							) == self.charge_factor and self.values.count(__a							) == 0
         ):
            return key
         return super()._collision_resolution(__a					,__a							)





'''simple docstring'''

def __UpperCamelCase(   _A					:				int    ):
   '''simple docstring'''

   if length <= 0 or not isinstance(_A  ,			_A    ):
      raise ValueError('''Length must be a positive integer.'''    )
   return [n * (2 * n - 1) for n in range(_A    )]


if __name__ == "__main__":
  print(hexagonal_numbers(length=5))
  print(hexagonal_numbers(length=10))




