#C6859. Audit Customer Subscription Data for Consistency
Audit Customer Subscription Data for Consistency
Audit Customer Subscription Data for Consistency
You are given customer subscription data where each record consists of an email address and its corresponding subscription type. Due to potential errors during data collection, the same email may appear with different subscription types.
Your task is to detect any such inconsistencies. If an email has been associated with more than one subscription type, then that email is considered conflicting.
If no conflicts are found, output Consistent
. Otherwise, output the conflicting email addresses sorted in lexicographical order, each on a separate line.
Note: In any formula or explanation, use \( \LaTeX \) format if needed.
inputFormat
The input is given via stdin and has the following format:
- The first line contains an integer \( n \), the number of customer records.
- The following \( n \) lines each contain two strings: an email address and a subscription type, separated by a space.
outputFormat
Output the result to stdout in the following format:
- If no conflicts exist, output the string
Consistent
. - If there are conflicts, output each conflicting email address on its own line, sorted in lexicographical order.
3
a@example.com basic
b@example.com premium
c@example.com basic
Consistent
</p>