Skip to content

Conversation

@DataWorshipper
Copy link

Description of Change

This pull request adds a C++ implementation of the Sliding Window XOR problem to the Bit Manipulation section.

The algorithm calculates the bitwise XOR of every window of size k in an array of n integers generated using the recurrence relation:

The array of size n is generated using the recurrence:

arr[0] = x;                 // first element
arr[i] = (a * arr[i-1] + b) % c;  // for i = 1 to n-1

It maintains a sliding window of size k using two pointers, efficiently computing the cumulative XOR of all windows in O(n) time with O(n) space.

The submission is self-contained, with detailed Doxygen documentation and a test() function that includes multiple verified test cases to ensure correctness.

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate
  • I acknowledge that all my contributions will be made under the project's license

Notes: Adds an O(n) solution for computing cumulative XOR of sliding windows in arrays of size n using a two-pointer technique. Includes self-test cases and detailed documentation.

@DataWorshipper
Copy link
Author

I need to change some things in the pr

@github-actions
Copy link
Contributor

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Author has not responded to the comments for over 2 weeks label Nov 24, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2025

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions github-actions bot closed this Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Author has not responded to the comments for over 2 weeks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant