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
In python please. Given an array of distinct integers a, your task is to find the number of pairs of indices (i, j) such
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
In python please. Given an array of distinct integers a, your task is to find the number of pairs of indices (i, j) such
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!