Tap here to switch tabs
Problem
Submissions

Problem: Make the XOR of All Segments Equal to Zero

Try to solve the Make the XOR of All Segments Equal to Zero problem.

Statement

You are given an integer array nums and an integer k.

The bitwise $ ext{XOR}$ of a contiguous segment of length k is the bitwise $ ext{XOR}$ of all elements in that segment.

Return the minimum number of elements you need to modify in nums such that the bitwise $ ext{XOR}$ of every contiguous segment of length k is equal to 00.

Constraints:

  • 1≤1 \leq k ≤\leq nums.length ≤2000\leq 2000

  • 0≤0 \leq nums[i] <210< 2^{10}

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Make the XOR of All Segments Equal to Zero

Try to solve the Make the XOR of All Segments Equal to Zero problem.

Statement

You are given an integer array nums and an integer k.

The bitwise $ ext{XOR}$ of a contiguous segment of length k is the bitwise $ ext{XOR}$ of all elements in that segment.

Return the minimum number of elements you need to modify in nums such that the bitwise $ ext{XOR}$ of every contiguous segment of length k is equal to 00.

Constraints:

  • 1≤1 \leq k ≤\leq nums.length ≤2000\leq 2000

  • 0≤0 \leq nums[i] <210< 2^{10}