#C8023. Two Sum Problem

    ID: 51960 Type: Default 1000ms 256MiB

Two Sum Problem

Two Sum Problem

Given an array of integers and a target integer \(T\), find two distinct indices \(i\) and \(j\) such that \(array[i] + array[j] = T\). If a valid pair exists, print the two indices separated by a space. Otherwise, print [] to indicate that no solution exists.

Note: The input is provided via standard input, and exactly one valid pair is expected if a solution exists.

inputFormat

The input consists of two lines read from stdin:

  1. The first line contains space-separated integers representing the array.
  2. The second line contains a single integer representing the target sum \(T\).

outputFormat

If a valid pair exists, output the two 0-indexed indices separated by a space using stdout. Otherwise, output [].

## sample
2 7 11 15
9
0 1