Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q2: Create a text file containing the below mentioned Input Format. You have to read the text file and store the content in the form
Q2: Create a text file containing the below mentioned Input Format. You have to read the text file and store the content in the form of arrays. 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. Part b) Analysis your solution for part a of Q2, and Write the Worst Case Complexity in comments at the top of your.cpp file Submission instructions: Make sure that the main executable class is called 'main.cpp' spelt exactly as given here so the main function name must also be 'main'. (This is to enable automated testing Text File 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: 1T50 1 s X, N s 13000 1 A[i] 109 SAMPLE INPUT % SAMPLE OUTPUT Average Average Average Good 1425 4215 4 3 S 2 41 1 2 4 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started