#C13331. Two Sum Indices
Two Sum Indices
Two Sum Indices
Given an array of integers and a target integer \(T\), your task is to find two distinct indices \(i\) and \(j\) such that \(nums[i] + nums[j] = T\). If such a pair exists, output the indices as a tuple in the form \((i, j)\); otherwise, output an empty tuple \(()\). It is assumed that each input has at most one valid solution.
inputFormat
The input is read from standard input (stdin). The first line contains an integer \(n\), the number of elements in the array. The second line contains \(n\) space-separated integers representing the array \(nums\). The third line contains the target integer \(T\).
outputFormat
Print the resulting tuple of indices in the format (i, j)
if a valid pair is found; otherwise, print an empty tuple ()
to standard output (stdout).
4
2 7 11 15
9
(0, 1)