
from __future__ import annotations







def 						_snake_case(  SCREAMING_SNAKE_CASE__    )			->   bool:
       return len(set(SCREAMING_SNAKE_CASE__    )    ) == len(SCREAMING_SNAKE_CASE__    )


if __name__ == "__main__":
  import doctest

  doctest.testmod()


def 						_snake_case(  SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__    )			->   int:

       def count_of_possible_combinations(SCREAMING_SNAKE_CASE__    ) -> int:
              if target < 0:
                     return 0
              if target == 0:
                     return 1
              return sum(count_of_possible_combinations(target - item    ) for item in array    )

       return count_of_possible_combinations(SCREAMING_SNAKE_CASE__    )







def 						_snake_case(  SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__    )			->   int:

       def count_of_possible_combinations_with_dp_array(
           SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__    ) -> int:
              if target < 0:
                     return 0
              if target == 0:
                     return 1
              if dp_array[target] != -1:
                     return dp_array[target]
              lowercase							:					Any	     =				sum(
                  count_of_possible_combinations_with_dp_array(target - item ,     SCREAMING_SNAKE_CASE__    )
                  for item in array    )
              lowercase							:					Optional[int]	     =				answer
              return answer

       lowercase							:					int	     =				[-1] * (target + 1)
       return count_of_possible_combinations_with_dp_array(SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__    )







def 						_snake_case(  SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__ ,     SCREAMING_SNAKE_CASE__    )			->   int:
       lowercase							:					str	     =				[0] * (target + 1)
       lowercase							:					Tuple	     =				1

       for i in range(1 ,     target + 1    ):
              for j in range(SCREAMING_SNAKE_CASE__    ):
                     if i - array[j] >= 0:
                            dp_array[i] += dp_array[i - array[j]]

       return dp_array[target]


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  lowercase  : Any						   =							3
  lowercase  : Optional[Any]						   =							5
  lowercase  : Tuple						   =							[1, 2, 5]
  print(combination_sum_iv(n, array, target))
