#K41542. Max Unique Snacks

    ID: 26888 Type: Default 1000ms 256MiB

Max Unique Snacks

Max Unique Snacks

You are given an integer n representing the total number of snacks, an integer k representing a target number of unique snack types, and a list of n integers representing the snack types. Your task is to calculate the maximum number of unique snack types that can be achieved. In other words, if the total number of distinct snack types is m, you should output \( \min(m, k) \).

Input Format: The first line contains two integers n and k. The second line contains n space-separated integers representing the snack types.

Output Format: Print a single integer which is the maximum number of unique snack types bounded by the target k.

inputFormat

The first line of input contains two integers n and k. The second line contains n integers separated by spaces, representing the snack types.

outputFormat

Output a single integer: the maximum number of unique snack types, which is \( \min(\text{unique count}, k) \).

## sample
6 4
1 2 2 3 3 1
3

</p>