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
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