#K92637. Two Sum Problem

    ID: 38242 Type: Default 1000ms 256MiB

Two Sum Problem

Two Sum Problem

Given a list of non-negative integers and a non-negative integer target, determine if there exist two distinct indices i and j in the list such that \(nums[i] + nums[j] = target\). In other words, check if there exists a pair \((i, j)\) with \(i \neq j\) that satisfies the equation.

This problem challenges you to efficiently determine whether such a pair exists.

inputFormat

The input is read from stdin and consists of three lines:

  1. The first line contains a single integer \(n\), the number of elements in the array.
  2. The second line contains \(n\) space-separated non-negative integers representing the array elements.
  3. The third line contains a single non-negative integer representing the target sum \(target\).

outputFormat

Output a single line to stdout: "True" if there exist two distinct numbers in the array whose sum is equal to the target, otherwise "False".

## sample
4
1 2 3 9
8
False