Exercise: Sum Two Linked Lists

Challenge yourself with the following exercise in which you'll sum up two linked lists!

We'll cover the following

Problem #

In this exercise, you are required to sum two linked lists and return the sum embedded in another linked list.

The first number that we append to the linked list represents the unit place and will be the least significant digit of a number. The next numbers appended to the linked list will subsequently represent the tenth, hundredth, thousandth, and so on places.

For example,

llist1 = LinkedList()
llist1.append(5)
llist1.append(6)
llist1.append(3)

in the code above, llist1 represents the number 365.

Note that you will not be tested on numbers whose sum requires an additional digit.

Below is an illustration to make the task clearer to you:

Get hands-on with 1200+ tech skills courses.