Company: MThree
Difficulty: medium
Valid Pairs Given the wealth values of `n` people, count unordered pairs of distinct people whose wealth sum is a positive power of three. Input Format The first line contains `n`. The second line contains `n` positive integers. Output Format Print the number of valid pairs. Constraints - `1 <= n <= 200000` - `1 <= wealth[i] <= 3486784401` Example Input ``` 4 1 2 7 8 ``` Output ``` 2 ``` The valid pairs are `(1,2)` and `(2,7)`.