ByteByteGo logo
menuProblems List

Lonely Integer

Easy

Given an integer array where each number occurs twice except for one of them, find the unique number.

Example:

Input: nums = [1, 3, 3, 2, 1]
Output: 2

Constraints:

  • nums contains at least one element.

You can practice coding exercises online by logging into bytebytego.com on your laptop.