Esempio n. 1
0
def test(nums):
    head = array_to_nodes(nums)
    return nodes_to_array(swap_pairs(head))
def test(l1, l2):
    head1 = array_to_nodes(l1)
    head2 = array_to_nodes(l2)
    result = merge_two_lists(head1, head2)
    return nodes_to_array(result)
Esempio n. 3
0
def test(array, k):
    head = array_to_nodes(array)
    result = reverse_k_group(head, k)
    return nodes_to_array(result)
Esempio n. 4
0
def test(nums, n):
    head = array_to_nodes(nums)
    result = remove_nth_from_end(head, n)
    return nodes_to_array(result)
Esempio n. 5
0
def test(nums_list):
    lists = list()
    for nums in nums_list:
        lists.append(array_to_nodes(nums))

    return nodes_to_array(merge_k_lists(lists))