From c6e71464df37b6cf393dfcc4eae6ef8106bcb5ba Mon Sep 17 00:00:00 2001 From: F4NT0 Date: Wed, 24 Apr 2024 12:34:33 -0300 Subject: [PATCH] #2 Update description --- 2/README.md | 34 ++++++++++++++++++++++++++++++---- README.md | 5 ++++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/2/README.md b/2/README.md index 21da6fc..85fcd8d 100644 --- a/2/README.md +++ b/2/README.md @@ -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. diff --git a/README.md b/README.md index 293852a..f33c31f 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,12 @@ ## Linked List Challenges +- [2. Add Two Numbers](My-LeetCode-Solvings/blob/main/2/README.md) $\color{yellow}\sf Medium$ - [876. Middle of the Linked List](My-LeetCode-Solvings/blob/main/876/README.md) $\color{lightgreen}\sf Easy$ ## StringBuilder Challenges -- [1249. Minimum Remove to Make Valid Parentheses](My-LeetCode-Solvings/blob/main/1249/README.md) $\color{gold}\sf Medium$ +- [1249. Minimum Remove to Make Valid Parentheses](My-LeetCode-Solvings/blob/main/1249/README.md) $\color{yellow}\sf Medium$ - [1544. Make The String Great](My-LeetCode-Solvings/blob/main/1544/README.md) $\color{lightgreen}\sf Easy$ - [1768. Merge Strings Alternately](My-LeetCode-Solvings/blob/main/1768/README.md) $\color{lightgreen}\sf Easy$ @@ -60,6 +61,7 @@ | Challenge | Status |---|---| | 1. TwoSum | [![1 - Testing Results](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/1.yml/badge.svg)](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/1.yml) +| 2. Add Two Numbers | [![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) | 9. Palindrome Number| [![9 - Testing Results](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/9.yml/badge.svg)](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/9.yml) | 28. Find the Index of the First Occurrence in a String | [![28 - Testing Results](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/28.yml/badge.svg)](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/28.yml) | 58. Length of Last Word| [![58 - Testing Results](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/58.yml/badge.svg)](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/58.yml) @@ -69,6 +71,7 @@ | 383. Ransom Note | [![383 - Testing Results](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/383.yml/badge.svg)](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/383.yml) | 389. Find the Difference | [![389 - Testing Results](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/389.yml/badge.svg)](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/389.yml) | 412. Fizz Buzz | [![412 - Testing Results](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/412.yml/badge.svg)](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/412.yml) +| 678. Valid Parenthesis String | [![678 - Testing Results](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/678.yml/badge.svg)](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/678.yml) | 876. Middle of the Linked List | [![876 - Testing Results](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/876.yml/badge.svg)](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/876.yml) | 1249. Minimum Remove to Make Valid Parentheses | [![1249 - Testing Results](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/1249.yml/badge.svg)](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/1249.yml) | 1342. Number of Steps to Reduce a Number to Zero | [![1342 - Testing Results](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/1342.yml/badge.svg)](https://github.com/F4NT0/My-LeetCode-Solvings/actions/workflows/1342.yml)