Make XOR of All Segments Zero

Given an array and a segment length k, you may change any element to any integer value. Find the minimum number of changes required so that every contiguous subarray of length k has an XOR of 0.

Examples
Input: [[1,2,0,3,0],1]
Output: 3
Hints

Make XOR of All Segments Zero

Given an array and a segment length `k`, you may change any element to any integer value. Find the minimum number of changes required so that every contiguous subarray of length `k` has an XOR of 0.