020-002-003
Set: No Duplicate Collection
Hard
Problem Description
Set: No Duplicate Collection
Learning Objective
Learn how to create collections without duplicates using Set.
Problem
Input multiple numbers and display the count after removing duplicates.
Input
Line 1: Count of numbers N
Line 2+: N numbers
Output
Unique count: [count without duplicates].
Test Cases
※ Output examples follow programming industry standards
Input:
5 1 2 2 3 3
Expected Output:
Unique count: 3
Input:
3 5 5 5
Expected Output:
Unique count: 1
❌ Some tests failed
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here
sc.close();
}
}
0 B / 5 MB
You have 9 free executions remaining
