Find Pair With Given Sum in an Array
Given an array of integers and a value, determine if there are any two integers in the array whose sum is equal to the given value.
Statement
We’re given an array of integers and a value. Determine if there are any two integers in the array whose sum is equal to the given value. Return true
if the sum exists; otherwise, return false
.
Example
Consider this array and the target sums:
Access this course and 1400+ top-rated courses and projects.