Tap here to switch tabs
Problem
Submissions

Problem: Add Two Numbers II

med
30 min
Try to solve the Add Two Numbers II problem.

Statement

You are given two non empty singly linked lists l1 and l2 that represent two non negative integers. Each node stores a single digit in Node.val, and the digits are ordered from most significant to least significant.

Return the sum of the two numbers as a singly linked list in the same most significant to least significant digit order.

Note: Follow up: can you solve this without reversing the input lists?

Constraints:

  • The number of nodes in each of l1 and l2 is in the range [1,100][1, 100].

  • 0≤0 \leq Node.val ≤9\leq 9.

  • Each list represents a number with no leading zeros.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Add Two Numbers II

med
30 min
Try to solve the Add Two Numbers II problem.

Statement

You are given two non empty singly linked lists l1 and l2 that represent two non negative integers. Each node stores a single digit in Node.val, and the digits are ordered from most significant to least significant.

Return the sum of the two numbers as a singly linked list in the same most significant to least significant digit order.

Note: Follow up: can you solve this without reversing the input lists?

Constraints:

  • The number of nodes in each of l1 and l2 is in the range [1,100][1, 100].

  • 0≤0 \leq Node.val ≤9\leq 9.

  • Each list represents a number with no leading zeros.