992. Subarrays with K Different Integers 给定一个正整数数组,计算刚好有K个不同数的子数组的个数.(For example, [1,2,3,1,2] has 3 different integers: 1, 2, and 3.) 解法一:slide window 如果是求最多有K个不同元素的子数组,那么就是典型的slide window的题目,只需要在这个典型题目上增添一步: exactly(K) = atMost(K) - atMost(K-1) cla…