README.md Güncelle

This commit is contained in:
Yavuz Sava 2025-03-28 20:13:13 +00:00
parent a51ade25ec
commit fbbd2b09e4

View File

@ -1,32 +1,31 @@
# LeetCode-1.Two_Sum_via_CPP # LeetCode-2.Add_Two_Numbers_via_CPP
## Problem Statement - Two Sum ## Problem Statement - Add Two Numbers
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. 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 that each input would have exactly one solution, and you may not use the same element twice. You may assume the two numbers do not contain any leading zero, except the number 0 itself.
You can return the answer in any order.
## Example 1: ## 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: ## Example 2:
Input: nums = [3,2,4], target = 6 Input: l1 = [0], l2 = [0]
Output: [1,2] Output: [0]
## Example 3: ## 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: ## 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 It is guaranteed that the list represents a number that does not have leading zeros.
Only one valid answer exists.