#K56907. Count Distinct Flowers
Count Distinct Flowers
Count Distinct Flowers
You are given a list representing a garden where each flower is described by a string containing its type and color. Your task is to determine the number of distinct flower descriptions.
For example, if the input list is ["rose red", "tulip yellow", "rose white", "rose red"], the distinct flowers are "rose red", "tulip yellow", and "rose white", leading to an answer of 3.
Note: The input begins with an integer representing the number of flowers, followed by lines each containing a flower description.
inputFormat
The input is provided via standard input (stdin) in the following format:
- The first line contains an integer , the number of flowers.
- The following lines each contain a string representing a flower's type and color.
outputFormat
Output a single integer to standard output (stdout), indicating the number of distinct flower descriptions.## sample
6
rose red
tulip yellow
rose white
rose red
daisy pink
tulip yellow
4