A bracelet-stringing log records the color (a positive integer) of each bead threaded on, in order, as an array of n integers. Given an integer K, count how many contiguous subarrays contain EXACTLY K distinct bead colors.
Input format
Line 1: two integers n and K.
Line 2: n space-separated positive integers, the bead colors in order.
Output format
A single integer: the number of contiguous subarrays with exactly K distinct colors.
Constraints
- 1 ≤ n ≤ 100000
- 0 ≤ K ≤ n
- 1 ≤ color ID ≤ 1000000000