


from __future__ import annotations


class 	A_ :




      '''simple docstring'''


      def __init__(    self:	Optional[int]						,				a:	str=None    ):
       __lowerCamelCase		:							Optional[int]		 =						data
       __lowerCamelCase		:							str		 =						None




      def __repr__(    self:	Optional[int]    ):
       __lowerCamelCase		:							str		 =						[]
       __lowerCamelCase		:							Tuple		 =						self
       while temp:
        string_rep.append(F'{temp.data}'    )
        __lowerCamelCase		:							Union[str, Any]		 =						temp.next
       return "->".join(a    )



def 				UpperCamelCase__					(  SCREAMING_SNAKE_CASE__						):
 if not elements_list:
  raise Exception('The Elements List is empty'						)

 __lowerCamelCase		:							List[str]		 =						Node(elements_list[0]						)
 for i in range(1      ,	len(SCREAMING_SNAKE_CASE__						)						):
  __lowerCamelCase		:							str		 =						Node(elements_list[i]						)
  __lowerCamelCase		:							str		 =						current.next
 return head
def 				UpperCamelCase__					(  SCREAMING_SNAKE_CASE__						):
 if head_node is not None and isinstance(SCREAMING_SNAKE_CASE__      ,	SCREAMING_SNAKE_CASE__						):
  print_reverse(head_node.next						)
  print(head_node.data						)
def 				UpperCamelCase__					(  ):
 from doctest import testmod

 testmod()

 __lowerCamelCase		:							Any		 =						make_linked_list([14, 52, 14, 12, 43]						)
 print('Linked List:'						)
 print(SCREAMING_SNAKE_CASE__						)
 print('Elements in Reverse:'						)
 print_reverse(SCREAMING_SNAKE_CASE__						)


if __name__ == "__main__":
       main()





def 				UpperCamelCase__					(  SCREAMING_SNAKE_CASE__      ,	SCREAMING_SNAKE_CASE__						):
 __lowerCamelCase		:							Union[str, Any]		 =						len(SCREAMING_SNAKE_CASE__						)
 __lowerCamelCase		:							Any		 =						[[False] * (required_sum + 1) for _ in range(arr_len + 1						)]

 # for each arr value, a sum of zero(0) can be formed by not taking any element
 # hence True/1
 for i in range(arr_len + 1						):
  __lowerCamelCase		:							Dict		 =						True

 # sum is not zero and set is empty then false
 for i in range(1      ,	required_sum + 1						):
  __lowerCamelCase		:							Union[str, Any]		 =						False

 for i in range(1      ,	arr_len + 1						):
  for j in range(1      ,	required_sum + 1						):
   if arr[i - 1] > j:
    __lowerCamelCase		:							Tuple		 =						subset[i - 1][j]
   if arr[i - 1] <= j:
    __lowerCamelCase		:							List[Any]		 =						subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]

 return subset[arr_len][required_sum]


if __name__ == "__main__":
       import doctest

       doctest.testmod()

