Company: Intuit_7aug
Difficulty: medium
AND Product of Subsequences Problem Description You are given an array of N integers. Consider every two-element subsequence of the array — that is, every pair of positions i ≤ j (including a position paired with itself) taken in the array's original order. For each such pair, compute its AND-Product: the bitwise AND of the two chosen elements (using the same element twice when i = j). Your task is to add up the AND-Products of every such pair and report the total. Please refer to the examples for understanding of the problem. Your solution should implement the following function signature: long solve(vector<int> arr) { // Write your code here return 0; // Placeholder } Examples Example 1: Input: arr = [1,2,3] Output: 9 Explanation: The answer is calculated as a summation of six subsequences as follows: AND-Product(1,1) + AND-Product(1,2) + AND-Product(1,3) + AND-Product(2,2) + AND-Product(2,3) + AND-Product(3,3) Example 2: Input: arr = [1,4] Output: 4 Explanation: The answer