Question: You are given two non - empty lists representing two non - negative integers. The digits are stored in reverse order, and each element in

You are given two non-empty lists representing two non-negative integers. The digits are stored in reverse order, and each element in the lists contains a single digit. Write a programme that adds the two numbers and return the sum as a list. You may assume the two numbers do not contain any leading zero, except the number 0 itself. For example, for an input of l1=[2,4,3] and l2=[5,6,4], the output is [7,0,8] because 342+464=807.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!