As reported: GoDaddy Inclusive Hackathon online assessment (2026), question 2: count subsets with a given XOR for multiple queries over prefixes of the array.
You are given an array arr of n integers and q queries. Query i is [end, k]: count the subsets of arr[0..end] (inclusive) whose XOR equals k. Subsets are chosen by index, so equal values at different positions give different subsets, and the empty subset (XOR 0) counts. Return each count modulo 10^9 + 7.
Example
arr = [1,2,3], queries = [[1,3],[2,0]] -> [1, 2]
query 1: subsets of [1,2] with XOR 3: {1,2}
query 2: subsets of [1,2,3] with XOR 0: {} and {1,2,3}
Constraints: 1 ≤ n, q ≤ 10^5; 0 ≤ arr[i], k < 2^20; 0 ≤ end < n.
Code runner format: two lines: arr as a JSON array, then queries as a JSON array of [end, k] pairs. Implement countXorSubsets(arr, queries); the harness prints the list of answers.