Roku SDE Interview Question 2021 October | Sliding Window | on-campus
Question · Posted Jun 2026
Question 1: Subarrays with K Different Integers Problem Statement Given an integer array nums and an integer k, return the absolute number of good subarrays of nums. A good subarray is defined as a contiguous subarray where the number of strictly different integers in that subarray is exactly equal to k. Constraints 1 <= nums.length <= 2 * 104 1 <= nums[i], k <= nums.length Examples Example 1: Input: nums = [1,2,1,2,3], k = 2 Output: 7 Explanation 1: The ...
The full answer & interview discussion are available to premium members.
Log in Create a free account