Given two array of integers, how many pairs exist that sum up to a power of 2? Efficient solution required.
Given two array of integers, how many pairs exist such that lower bound<=first number^2+second number^2<=upper bound? Efficient solution required.