老二其实很悲催# Biology - 生物学
z*y
1 楼
Given an array of numbers and a number X
find two elements a, b from the array such that a+b = X
My solution is sorting first then binary search
O(n log n)
I don't think it can be improved further, right?
find two elements a, b from the array such that a+b = X
My solution is sorting first then binary search
O(n log n)
I don't think it can be improved further, right?