#C8434. Case-Insensitive Duplicate Plate IDs
Case-Insensitive Duplicate Plate IDs
Case-Insensitive Duplicate Plate IDs
You are given a list of plate IDs. Your task is to determine if there exists any pair of plate IDs that are identical when compared in a case-insensitive manner. In other words, convert each plate ID to lowercase and check if any two are the same.
Example:
If the plate IDs are: AbC
, aBC
, xyz
, XYz
, then after converting to lowercase they become: abc
, abc
, xyz
, xyz
. Since there are duplicates, the output should be YES
.
Note: The comparison is case-insensitive. Even an empty string is a valid plate ID.
inputFormat
The input is read from stdin and has the following format:
- The first line contains a single integer \( n \), the number of plate IDs.
- The following \( n \) lines each contain a plate ID as a string. A plate ID may be empty or contain spaces.
outputFormat
Output a single line to stdout containing YES
if there is at least one pair of duplicate plate IDs when compared case-insensitively; otherwise, output NO
.
4
AbC
aBC
xyz
XYz
YES