Pretty Subsets Count

Given an integer array nums and an integer k, count contiguous subarrays where the XOR of all elements has at most k unset bits (0 bits) in its 32-bit binary representation. A subarray is pretty if its XOR value contains 32 - popcount(XOR) <= k zero bits. Return the total count of such subarrays.

Examples
Input: [[1,2,3,4],2]
Output: 7
Hints

Pretty Subsets Count

Given an integer array nums and an integer k, count contiguous subarrays where the XOR of all elements has at most k unset bits (0 bits) in its 32-bit binary representation. A subarray is pretty if its XOR value contains 32 - popcount(XOR) <= k zero bits. Return the total count of such subarrays.