Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 373 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 373 Bytes

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)