Tap here to switch tabs
Problem
Submissions

Problem: The Two Sneaky Numbers of Digitville

med
30 min
Try to solve the The Two Sneaky Numbers of Digitville problem.

Statement

You are given an integer array nums of length n +2+ 2, which contains numbers ranging from 00 to n −1- 1. In this collection, exactly two numbers appear twice, while every other integer appears once.

Return an array containing the two duplicate numbers. The resulting numbers may be returned in any order.

Constraints:

  • 2≤2 \leq n ≤100\leq 100

  • nums.length ==== n +2+ 2

  • 0≤0 \leq nums[i] << n

  • The input is generated such that nums contains exactly 22 repeated elements.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: The Two Sneaky Numbers of Digitville

med
30 min
Try to solve the The Two Sneaky Numbers of Digitville problem.

Statement

You are given an integer array nums of length n +2+ 2, which contains numbers ranging from 00 to n −1- 1. In this collection, exactly two numbers appear twice, while every other integer appears once.

Return an array containing the two duplicate numbers. The resulting numbers may be returned in any order.

Constraints:

  • 2≤2 \leq n ≤100\leq 100

  • nums.length ==== n +2+ 2

  • 0≤0 \leq nums[i] << n

  • The input is generated such that nums contains exactly 22 repeated elements.