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:](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/10/670f9d53007ea_562670f9d52b797d.jpg)
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
Get step-by-step solutions from verified subject matter experts
