Single Number II Problem
Single Number II Problem — ExecCode Easy DSA Practice
Solve the Single Number II problem on ExecCode. Free online easy DSA practice in Bit Manipulation. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Given an integer array nums where every element appears exactly three times except for one, which appears exactly once, find and return the single element using only constant extra space.
Examples
Input nums = [2, 2, 3, 2]; Output 3. Input nums = [0, 1, 0, 1, 0, 1, 99]; Output 99. Input nums = [5, 5, 5, 7]; Output 7
Constraints
1 <= nums.length <= 30000 -2^31 <= nums[i] <= 2^31 - 1 Every element appears exactly three times except one
Practice Single Number II free on ExecCode. Browse DSA problems, topic map, and placement guides.