Practice The Two Sneaky Numbers of Digitville
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
In the town of Digitville, there was a list of numbers called nums containing integers from 0 to n - 1. Each number was supposed to appear exactly once in the list, however, two mischievous numbers sneaked in an additional time, making the list longer than usual. As the town detective, your task is to find these two sneaky numbers. Return an array of size two containing the two numbers (in any order), so peace can return to Digitville.
Source: The Two Sneaky Numbers of Digitville on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
nums = [0,1,1,0]
[0,1]
# Example 2
nums = [0,3,2,1,3,2]
[2,3]
# Example 3
nums = [7,1,5,4,3,4,6,0,9,5,8,2]
[4,5]
Constraints
Related LeetCode Problems
Practice more problems similar to The Two Sneaky Numbers of Digitville.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.