



'''simple docstring'''




from collections import deque

from .hash_table import HashTable







class       _lowerCAmelCase				(     _a					):


	def __init__(self			, *lowercase			, **lowercase				):
				super().__init__(*__lowerCamelCase			, **__lowerCamelCase				)


	def        _a      (self			, lowercase			, lowercase				):
				A_      :		List[str]      =	deque([]				) if self.values[key] is None else self.values[key]
				self.values[key].appendleft(__lowerCamelCase				)
				A_      :		Dict      =	self.values[key]


	def        _a      (self				):
				return (
				    sum(self.charge_factor - len(__lowerCamelCase				) for slot in self.values				)
				    / self.size_table
				    * self.charge_factor
				)


	def        _a      (self			, lowercase			, lowercase=None				):
				if not (
				    len(self.values[key]				) == self.charge_factor and self.values.count(__lowerCamelCase				) == 0
				):
							return key
				return super()._collision_resolution(__lowerCamelCase			, __lowerCamelCase				)





from __future__ import annotations
def 		a_							( __lowerCAmelCase				):
  if not nums:
    return 0
  lowerCAmelCase__										=      nums[0]
  lowerCAmelCase__										=      0
  for num in nums[1:]:
    lowerCAmelCase__				,      lowerCAmelCase__										=      (
        max_excluding + num,
        max(__lowerCAmelCase   , __lowerCAmelCase				),
    )
  return max(__lowerCAmelCase   , __lowerCAmelCase				)


if __name__ == "__main__":
      import doctest

      doctest.testmod()

