LeetCode-Problem-Solution icon indicating copy to clipboard operation
LeetCode-Problem-Solution copied to clipboard

Update SingleNumber Implementation to Use Bitwise XOR #143

Open harshendram opened this issue 1 year ago • 0 comments

I propose updating the implementation to use the XOR bitwise operation, which provides a more efficient solution. The XOR approach has a time complexity of O(n) but reduces the space complexity to O(1), as it does not require any additional data structures.

  • [x] I have read CONTRIBUTING.md.
  • [x] This pull request is all my own work -- I have not plagiarized it.
  • [x] All functions and variable names follow Clean Code naming conventions.
  • [ ] This code follows the clang-format style.

harshendram avatar Oct 01 '24 12:10 harshendram