mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2026-10-25 17:42:27 +08:00
* refactor: clean to roadmap content * refactor: move shared helpers into scripts/lib
761 B
761 B
Single Number
Given an array where every element appears twice except one, find the element that appears only once. XOR of a number with itself is zero, and XOR of a number with zero is the number itself, so XOR-ing all elements cancels duplicates and leaves the unique one. This problem is the entry point to bit manipulation and teaches you that XOR is a surprisingly powerful tool for finding missing or unique values.
Visit the following resources to learn more: