⚡️ Tryprepforge
Backend Engineer Senior programming

You have a sorted array of integers, where each integer appears twice except for one integer which appears only once. Write a function to find that single integer. ### Function Signature ```python def single_number(nums: List[int]) -> int: ``` ### Constraints - `1 <= nums.length <= 10^5` - `0 <= nums[i] <= 10^5` ### Examples 1. Input: `single_number([1, 1, 2, 2, 3])` Output: `3` 2. Input: `single_number([4, 1, 2, 1, 2])` Output: `4`

Suggested Answer

Practice More Questions Like This

Generate unlimited interview questions with structured answers, code runner, and AI-powered walkthroughs.

No credit card required

More Backend Engineer Interview Prep

Link copied to clipboard