#K2891. Find Pair Sum
Find Pair Sum
Find Pair Sum
Given an array of integers and a target sum \(T\), determine whether there exists a pair of distinct elements in the array such that their sum equals \(T\). This problem tests your ability to efficiently search for two numbers that add up to a given value.
Note: The input is provided via standard input (STDIN) and the output must be printed to standard output (STDOUT). The solution should handle cases where the array is empty or contains only one element.
inputFormat
The first line of the input contains two integers \(N\) and \(T\), where \(N\) is the number of elements in the array and \(T\) is the target sum. The second line contains \(N\) space-separated integers representing the elements of the array.
Example:
5 9 2 7 11 15 1
outputFormat
Output a single line: True
if there exists a pair whose sum equals \(T\), or False
otherwise.
Example:
True## sample
5 9
2 7 11 15 1
True