#C5968. Find Two Sum Indices
Find Two Sum Indices
Find Two Sum Indices
Given an array of integers and a target integer \( T \), your task is to find the indices of two numbers in the array such that their sum equals \( T \) (i.e. for some indices \( i \) and \( j \), \( \text{arr}[i] + \text{arr}[j] = T \)). If no such pair exists, output "-1 -1".
Note that the indices should be based on 0-indexing, and if there are multiple possible answers, output the first valid pair found.
inputFormat
The first line contains two space-separated integers: \( n \) (the number of elements in the array) and \( T \) (the target sum).
The second line contains \( n \) space-separated integers representing the elements of the array.
outputFormat
Output two space-separated integers representing the indices of the two numbers whose sum equals \( T \). If no such pair exists, output "-1 -1".
## sample4 9
2 7 11 15
0 1