From fbbd2b09e45a1cad3fd01cfb933cd2452521c02e Mon Sep 17 00:00:00 2001 From: Yavuz Sava Date: Fri, 28 Mar 2025 20:13:13 +0000 Subject: [PATCH] =?UTF-8?q?README.md=20G=C3=BCncelle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 85d813d..d34f471 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,31 @@ -# LeetCode-1.Two_Sum_via_CPP +# LeetCode-2.Add_Two_Numbers_via_CPP -## Problem Statement - Two Sum -Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. -You may assume that each input would have exactly one solution, and you may not use the same element twice. -You can return the answer in any order. +## Problem Statement - Add Two Numbers +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: nums = [2,7,11,15], target = 9 +()[https://assets.leetcode.com/uploads/2020/10/02/addtwonumber1.jpg$0] -Output: [0,1] +Input: l1 = [2,4,3], l2 = [5,6,4] -Explanation: Because nums[0] + nums[1] == 9, we return [0, 1]. +Output: [7,0,8] + +Explanation: 342 + 465 = 807. ## Example 2: -Input: nums = [3,2,4], target = 6 +Input: l1 = [0], l2 = [0] -Output: [1,2] +Output: [0] ## Example 3: -Input: nums = [3,3], target = 6 +Input: l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9] -Output: [0,1] +Output: [8,9,9,9,0,0,0,1] ## Constraints: -2 <= nums.length <= 104 +The number of nodes in each linked list is in the range [1, 100]. --109 <= nums[i] <= 109 +0 <= Node.val <= 9 --109 <= target <= 109 - -Only one valid answer exists. +It is guaranteed that the list represents a number that does not have leading zeros. \ No newline at end of file