


from __future__ import annotations






def 		lowercase_(  SCREAMING_SNAKE_CASE_				,						SCREAMING_SNAKE_CASE_				,						SCREAMING_SNAKE_CASE_				,						SCREAMING_SNAKE_CASE_     ):


  '''simple docstring'''

  if counter == 0 or capacity == 0:
    return 0

  # If weight of the nth item is more than Knapsack of capacity,
  #   then this item cannot be included in the optimal solution,
  # else return the maximum of two cases:
  #   (1) nth item included
  #   (2) not included
  if weights[counter - 1] > capacity:
    return knapsack(SCREAMING_SNAKE_CASE_				,						SCREAMING_SNAKE_CASE_				,						SCREAMING_SNAKE_CASE_				,						counter - 1     )
  else:
    lowerCamelCase			: List[str]   =    capacity - weights[counter - 1]
    lowerCamelCase			: List[str]   =    values[counter - 1] + knapsack(
        SCREAMING_SNAKE_CASE_				,						SCREAMING_SNAKE_CASE_				,						SCREAMING_SNAKE_CASE_				,						counter - 1     )
    lowerCamelCase			: int   =    knapsack(SCREAMING_SNAKE_CASE_				,						SCREAMING_SNAKE_CASE_				,						SCREAMING_SNAKE_CASE_				,						counter - 1     )
    return max(SCREAMING_SNAKE_CASE_				,						SCREAMING_SNAKE_CASE_     )


if __name__ == "__main__":
   import doctest

   doctest.testmod()







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


_snake_case					=					{'''configuration_hubert''': ['''HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''HubertConfig''']}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _snake_case					=					[
       '''HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''HubertForCTC''',
       '''HubertForSequenceClassification''',
       '''HubertModel''',
       '''HubertPreTrainedModel''',
   ]


try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _snake_case					=					[
       '''TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
       '''TFHubertForCTC''',
       '''TFHubertModel''',
       '''TFHubertPreTrainedModel''',
   ]

if TYPE_CHECKING:
   from .configuration_hubert import HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, HubertConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_hubert import (
          HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          HubertForCTC,
          HubertForSequenceClassification,
          HubertModel,
          HubertPreTrainedModel,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_hubert import (
          TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFHubertForCTC,
          TFHubertModel,
          TFHubertPreTrainedModel,
      )


else:
   import sys

   _snake_case					=					_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



