Skip to content

Practice Unique Number of Occurrences

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#1207
LeetCode Problem

Unique Number of Occurrences

Problem Statement

Given an array of integers arr, return true if the number of occurrences of each value in the array is unique or false otherwise.

Source: Unique Number of Occurrences on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
arr = [1,2,2,1,1,3]
Output
true

# Example 2

Input
arr = [1,2]
Output
false

# Example 3

Input
arr = [-3,0,1,-3,1,1,1,-3,10,0]
Output
true

Constraints

1 <= arr.length <= 1000
-1000 <= arr[i] <= 1000

Related LeetCode Problems

Practice more problems similar to Unique Number of Occurrences.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.