Tap here to switch tabs
Problem
Submissions

Problem: Count Integers Appearing in a Single Block

Count Integers Appearing in a Single Block asks you to inspect an integer array and count the distinct values whose every occurrence lies together in one contiguous block.

Statement

You are given an integer array nums.

An integer is considered special if all of its occurrences in nums appear together in a single contiguous block.

Return the total number of distinct special integers in nums.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Integers Appearing in a Single Block

Count Integers Appearing in a Single Block asks you to inspect an integer array and count the distinct values whose every occurrence lies together in one contiguous block.

Statement

You are given an integer array nums.

An integer is considered special if all of its occurrences in nums appear together in a single contiguous block.

Return the total number of distinct special integers in nums.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100