#K8176. Find Pair with Sum
Find Pair with Sum
Find Pair with Sum
You are given an array of integers and a target integer. Your task is to find two distinct indices i and j (with i < j) such that the sum of the corresponding elements equals the target.
If such a pair exists, output the indices (0-indexed) separated by a space. Otherwise, output nothing.
Formally, given an array \(A\) of length \(n\) and an integer \(T\), find indices \(i\) and \(j\) (with \(0 \le i < j < n\)) satisfying
\[ A_i + A_j = T \]inputFormat
The first line contains two integers \(n\) and \(target\), where \(n\) is the number of elements in the array. The second line contains \(n\) integers separated by spaces.
outputFormat
If a valid pair exists, output the two indices separated by a space in a single line. If no such pair exists, output nothing.
## sample4 9
2 7 11 15
0 1