Two Sum Problem | Beginner

Опубликовано: 22 Декабрь 2023
на канале: Tutorial Horizon
329
2

Complete Post - https://tutorialhorizon.com/algorithm...

Given an array of integers, and k. Write a program to find indexes of two elements in an array which sum is equal to K.

Example:

Given array: [5, 4, 7, 3, 9, 2], Sum = 13
Output: Found indexes are: 4 and 1

Given array: [1, 2, 3, 4, 5], Sum = 9
Found indexes are: 4 and 3

Given array: [1, 2, 3, 4, 5], Sum = 10
No indexes are found