Page 1 of 1

In python please. Given an array of distinct integers a, your task is to find the number of pairs of indices (i, j) such

Posted: Sun May 15, 2022 11:46 am
by answerhappygod
In python please.
Given an array of distinct integers a,
your task is to find the number of pairs of
indices (i, j) such that i
≤ j and the sum a +
a[j] is equal to some power of two.
Note:
numbers 20 =
1, 21 =
2, 22 =
4, 23 =
8, etc. are considered to be powers of two.
Example