Distinct Count
Practice
2.6 (126 votes)
Algorithms
Approved
Binary search tree
Easy
Open
Sets
Sorting
Trees
Problem
63% Success 21057 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Given an array A of N integers, classify it as being Good Bad or Average. It is called Good, if it contains exactly X distinct integers, Bad if it contains less than X distinct integers and Average if it contains more than X distinct integers.

Input format:
First line consists of a single integer T denoting the number of test cases.
First line of each test case consists of two space separated integers denoting N and X.
Second line of each test case consists of N space separated integers denoting the array elements.

Output format:
Print the required answer for each test case on a new line.

Constraints:
\(1 \le T \le 50\)
\(1 \le X, N \le 13000\)
\(1 \le A[i] \le 10^9\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
28 votes
Tags:
Binary search treeData StructuresEasySetsTrees
Points:20
238 votes
Tags:
Binary search treeEasyMapsOpenTrees