Mission 16: "The Core Code Optimization" 🔬
A data stream contains system IDs, but one ID is unique while all others are duplicated. Find the unique ID efficiently. The data stream is `[101, 202, 101, 303, 202]`.
00:00
Mission Objective
Use a `for` loop and the XOR (`^`) operator to find the single unique number in the `dataStream` array.
Step 1 / 2
1. The Story: The Mission Briefing
"The Labyrinth's core functions are too slow. Standard arithmetic is causing bottlenecks. To achieve the final level of efficiency, you must learn to manipulate data at its most fundamental level: the individual bits."
2. The Problem
How can you perform mathematical and logical operations faster than with traditional arithmetic?
3. The Task
You will use bitwise operators to solve a series of puzzles. First, you'll use the XOR operator to find a single unique number in a stream of duplicates. Then, you'll use bitmasking to check the status of a system flag.
4. Concepts Applied
Bitwise operators (XOR, AND), Bitmasking.