Count of pairs from Array with sum equal to twice their bitwise AND
Given an array arr[], the task is to count the pairs in the array with sum equal to twice their bitwise AND, i.e., [Tex]A + B = 2 * (A \& B) [/Tex]Examples: Input: arr[] = {1, 1, 3, 4, 4, 5, 7, 8} Output: 2 Explanation: Pairs with sum equal to twice their bitwise AND: {(1, 1), (4, 4)}Input: arr[