Question: A = [1, 2, 3, 1] K = 3 Input 2: A = [1, 2, 5] K = 3 Example Output Output 1: Output 2:

 A = [1, 2, 3, 1] K = 3 Input 2:

A = [1, 2, 3, 1] K = 3 Input 2: A = [1, 2, 5] K = 3 Example Output Output 1: Output 2: 1 Example Explanation Explanation 1: Xor of every 3 consecutive elements is already 0. No changes required. Explanation 2: We can change the first element to 7, so the array becomes [7, 2, 5] and Xor of every 3 consecutive elements is 0 now. Hence, number of changes required is 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!