#C7867. Unique Records Count
Unique Records Count
Unique Records Count
You are given a list of records, where each record is a comma-separated string with the format: (Title, Author, Year, Publisher, ISBN). The task is to count the number of unique records based only on the normalized (trimmed and case-insensitive) Title and Author fields.
Normalization is performed by removing any extra spaces from the beginning and end, and converting all characters to lowercase. For example, the two records " The Great Gatsby , F. Scott Fitzgerald ,1925,Scribner,978-0743273565" and "The Great Gatsby,F. Scott Fitzgerald,1925,Scribner,978-0743273565" are considered identical after normalization.
It is guaranteed that each record consists of at least two fields (Title and Author) separated by commas, followed by other attributes which can be ignored for uniqueness determination.
inputFormat
The input is read from standard input (stdin). The first line contains an integer (n) which denotes the number of records. This is followed by (n) lines, each containing a record in the format described above.
outputFormat
Output a single integer on standard output (stdout) which is the count of unique records based on the normalized Title and Author fields.## sample
3
The Great Gatsby , F. Scott Fitzgerald ,1925,Scribner,978-0743273565
The Great Gatsby,F. Scott Fitzgerald,1925,Scribner,978-0743273565
MOBY DICK, Herman Melville,1851,Harper & Brothers,978-1503280786
2
</p>