-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,40 @@ | ||
# 2 | ||
# 2. Add Two Numbers | ||
|
||
Level: $\color{lightgreen}{\sf Easy}$ OR $\color{gold}{\sf Medium}$ OR $\color{red}{\sf Hard}$ | ||
Level: $\color{gold}{\sf Medium}$ | ||
|
||
Language: C# | ||
|
||
Topic: $\color{yellow} \sf insert \space topic \space here$ | ||
Topic: $\color{yellow} \sf Linked List$ | ||
|
||
Unit Tests: [![2 - Testing Results](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/2.yml/badge.svg)](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/2.yml) | ||
|
||
--- | ||
|
||
ADD HERE THE DESCRIPTION OF THE PROJECT AND EXAMPLES | ||
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. | ||
|
||
Add the two numbers and return the sum as a linked list. | ||
|
||
You may assume the two numbers do not contain any leading zero, except the number 0 itself. | ||
|
||
## Example 1: | ||
|
||
- Input: l1 = [2,4,3], l2 = [5,6,4] | ||
- Output: [7,0,8] | ||
- Explanation: 342 + 465 = 807. | ||
|
||
## Example 2: | ||
|
||
- Input: l1 = [0], l2 = [0] | ||
- Output: [0] | ||
|
||
## Example 3: | ||
|
||
- Input: l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9] | ||
- Output: [8,9,9,9,0,0,0,1] | ||
|
||
## Constraints: | ||
|
||
- The number of nodes in each linked list is in the range [1, 100]. | ||
- 0 <= Node.val <= 9 | ||
- It is guaranteed that the list represents a number that does not have leading zeros. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters