Created
November 28, 2019 02:35
-
-
Save kwojcicki/8ad568fdb92bdc52669b7629f8399e4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pair findPairGivingSum(int[] numbers, int k){ | |
for(int i = 0; i < numbers.length; i++){ | |
for(int j = i + 1; j < numbers.length; j++){ | |
if(numbers[i] + numbers[j] == k){ | |
return new Pair(numbers[i], numbers[j]); | |
} | |
} | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment