#K47632. Count Unique Elements After XOR Operations
Count Unique Elements After XOR Operations
Count Unique Elements After XOR Operations
You are given an integer n representing the size of an array and an integer k representing the number of times a bitwise XOR operation is applied. The array is given as arr containing n integers. Although the problem statement refers to applying the XOR operation k times, it turns out that the number of unique elements in the array remains the same regardless of k.
Your task is to compute the number of unique elements in the array, i.e. to calculate $$ |\{a_i : 1 \le i \le n\}|, $$ where \(a_i\) denotes the i-th element of the array.
Note: The XOR operations are mentioned in the problem but do not affect the count of unique elements. Therefore, you can solve the problem by simply determining the number of distinct numbers in the array.
inputFormat
The first line contains two space-separated integers n and k, where n is the number of elements in the array and k is the number of XOR operations performed (which does not affect the output).
The second line contains n space-separated integers representing the array arr.
outputFormat
Output a single integer: the number of unique elements in the array.
## sample3 2
2 4 3
3