Skip to content

Latest commit

 

History

History

challenge-3

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Pair with sum = k

This problem was recently asked by Google.

Description

Given a list of numbers and a number k, return whether any two numbers from the list add up to k.

Examples

Input:
  arr: [10, 15, 3, 7]
  k: 17

Output:
  True (because 10 + 7 = 17)
Input:
  arr: [10, 15, 3, 7]
  k: 11

Output:
  False (no pair summed generates 11)