Given sorted list of integers implement a function which finds the first pair where the sum equals to 0
. Return an
pair that includes both values that sum to zero or null if a pair does not exist.
Challenge | Solution |
sumZero(listOf(1, 2)) // null
sumZero(listOf(-3, -2, 0, 1, 2)) // Pair(-2, 2)