<jupyter_start><jupyter_text>Task 1:Given three values, return a new linked list containing those values.You have to wrap the values into ListNode() objects.JavaScript:const new_node = new ListNode(n);Python:new_node = ListNode(n)You do not need to uncomment the ListNode code in the header. That's just there for your reference.Note the the tests will show the linked lists as if they are arrays. This is just the visual representation; under the hood, it's a linked list with those values.Return a reference to the head of the new list.<jupyter_code>def solution(a, b, c):
    x = ListNode(a)
    y = ListNode(b)
    z = ListNode(c)
    
    x.next = y
    y.next = z
    
    return x<jupyter_output><empty_output><jupyter_text>Task 2:Given a list, return length of the list--i,e, the number of nodes in the list.You do not need to uncomment the ListNode code in the header. That's just there for your reference.Note the the tests will show the linked lists as if they are arrays. This is just the visual representation; under the hood, it's a linked list with those values.<jupyter_code>def solution(head):
    current_node = head
    count = 0
    while current_node is not None:
        current_node = current_node.next
        count += 1
    return count<jupyter_output><empty_output><jupyter_text>Task 3:Given a list, return the sum of all the values in the list.If the input list is empty, return 0.You do not need to uncomment the ListNode code in the header. That's just there for your reference.Note the the tests will show the linked lists as if they are arrays. This is just the visual representation; under the hood, it's a linked list with those values.<jupyter_code>def solution(head):
    total = 0
    current_node = head
    while current_node is not None:
        total += current_node.value
        current_node = current_node.next
    return total<jupyter_output><empty_output><jupyter_text>Task 4:Given a list, return the value of the tail node in the list.If the input list is empty, return -9999.You do not need to uncomment the ListNode code in the header. That's just there for your reference.Note the the tests will show the linked lists as if they are arrays. This is just the visual representation; under the hood, it's a linked list with those values.<jupyter_code>def solution(a):
    if a is None:
        return -9999
    current_node = a
    while current_node.next is not None:
        current_node = current_node.next
    return current_node.value<jupyter_output><empty_output><jupyter_text>Task 5:Insert a new value at the head of a linked list.You have to wrap the value n into a ListNode() object.JavaScript:const new_node = new ListNode(n);Python:new_node = ListNode(n)You do not need to uncomment the ListNode code in the header. That's just there for your reference.Note the the tests will show the linked lists as if they are arrays. This is just the visual representation; under the hood, it's a linked list with those values.Return a reference to the new head of the list.<jupyter_code>def solution(n, a):
    new_node = ListNode(n)
    new_node.next = a
    return new_node<jupyter_output><empty_output><jupyter_text>Task 6:Given a list and a value, append the value to the end of the list.You have to wrap the value into a ListNode() object.JavaScript:const new_node = new ListNode(n);Python:new_node = ListNode(n)You do not need to uncomment the ListNode code in the header. That's just there for your reference.Note the the tests will show the linked lists as if they are arrays. This is just the visual representation; under the hood, it's a linked list with those values.Return a reference to the head of the list.<jupyter_code>def solution(a, n):
    new_node = ListNode(n)
    if a is None:
        return new_node
    current_node = a
    while current_node.next is not None:
        current_node = current_node.next
    current_node.next = new_node
    return a<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06003039513677812, 'fraction_numerical': 0.004559270516717325, 'mean_word_length': 3.979823455233291, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '665047', 'license': 'MIT', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1108, 'n_words': 530, 'path': 'Sprint3/S3Module_3_GCA_Practice.ipynb', 'repo_name': 'andresmvidaurre/GCAPractice', 'size': '3948'}