#K57912. Pair Sum Existence
Pair Sum Existence
Pair Sum Existence
This problem requires you to determine whether there is a pair of distinct integers in the given array whose sum equals a specified target value. You are given an integer n which is the number of elements in the array, a target sum value T, and a sequence of n integers. Your task is to find out if there exists any two distinct elements ai and aj (with i ≠ j) such that:
Print True
if such a pair exists; otherwise, print False
.
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 a single line with True
if there exists a pair of numbers in the array whose sum equals T
, otherwise output False
.
4 17
10 15 3 7
True