← 返回 google 的题目列表Add Two Large Numbers
类型:online_judge
Given two lists representing large integers, where each element of the list represents a digit of the integer with the most significant digit at the start of the list, write a function to simulate addition and return a list representing the sum. Note that the input lists may be empty or contain only zeros. For int add_large_numbers(list1, list2), example:
Input: list1 = [7, 2, 4, 3], list2 = [5, 6, 4]
Output: [7, 8, 0, 7]
Constraints:
The length of each list is in the range [0, 1000].
The elements' values are in the range [0, 9].
Example
Input
7 2 4 3 5 6 4