彭博 面试题# JobHunting - 待字闺中
k*t
1 楼
Given an unsorted array of positive integers, is it possible to find a pair
of integers from that array that sum up to a given sum?
Constraints: This should be done in O(n) and in-place (without any external
storage like arrays, hash-maps) (you can use extra variables/pointers)
If this is not possible, can there be a proof given for the same?
感觉不存在这样的解法。但怎么证明?
of integers from that array that sum up to a given sum?
Constraints: This should be done in O(n) and in-place (without any external
storage like arrays, hash-maps) (you can use extra variables/pointers)
If this is not possible, can there be a proof given for the same?
感觉不存在这样的解法。但怎么证明?