#K35382. Two Sum Problem
Two Sum Problem
Two Sum Problem
Given an unsorted array of integers \(A = [a_0, a_1, \dots, a_{n-1}]\) and an integer \(T\) (target), find the indices of the two numbers such that they add up to \(T\). You are guaranteed that each input has exactly one solution, and you may not use the same element twice.
Your task is to read the array and the target from the standard input and output the two indices separated by a space.
Example:
Input: 4 2 7 11 15 9</p>Output: 0 1
inputFormat
The first line contains an integer \(n\), representing the number of elements in the array. The second line contains \(n\) space-separated integers (\(a_0, a_1, \dots, a_{n-1}\)). The third line contains an integer \(T\), the target sum.
outputFormat
Print two integers separated by a space, which are the indices of the two numbers that add up to \(T\).
## sample4
2 7 11 15
9
0 1