Count Subarrays Where Max Element Appears at Least K Times

Count Subarrays Where Max Element Appears at Least K Times - Coding Problem | K5kC