camilito200009
BAN USER- 0of 0 votes
AnswersLet's assume that we have a binary classification system that classifies sets of samples, the rules for the classification are:
- camilito200009 in United States
The set is 'GOOD' if ALL the samples are 'GOOD'
The set is 'BAD' if ANY sample in the set is 'BAD'
Based on this we receive an input that contains multiple lines, where each line represents the classification of a set of samples. The format of each line is
class,sample_id_1,sample_id_2,...,sample_id_n
where class will either be GOOD or BAD. The sample IDs represent the samples contained in the classified set.
Now, for generating the output response we have to consider three cases:
If a unique mapping of samples-to-class exists, we output the corresponding mapping (sorted by the samples IDs)
If no consistent sample-to-class is possible, we output the answer NO CONSISTENT
If more than one mapping would be consistent, we output the answer MULTIPLE MAPPING.
To better illustrate the problem, following there are 4 examples
Sample Input
GOOD,10,11
GOOD,11,12
GOOD,10,12
Sample Output
10,GOOD
11,GOOD
12,GOOD
Sample Input
GOOD,10,11
BAD,11,12
Sample Output
10,GOOD
11,GOOD
12,BAD
Sample Input
GOOD,10,11
BAD,11,12
GOOD,11,13
GOOD,12,13
Sample Output
NO CONSISTENT
Sample Input
BAD,10,11
BAD,11,12
Sample Output
MULTIPLE MAPPING
If someone knows how to solve the problem, even if it's just pseudocode I'd really appreciate it| Report Duplicate | Flag | PURGE
Councyl Software Engineer Intern
RepSince 1991, Lakeview Blinds Awnings & Shutters offers stunning interior and exterior blinds, shutters, awnings and security doors & windows to the ...