Company: Visa_28aug
Difficulty: medium
Contiguous Fruit Sections with K Pairs Problem Description You're an inspector at a large fruit orchard. After harvesting, the fruits are laid out in a long conveyor belt. Your job is to identify sections of the conveyor belt that have a significant number of duplicate fruits. Specifically, you need to count the number of contiguous sections of the belt where you can form at least k pairs of identical fruits based on their position on the belt. Each fruit at a specific position can be part of at most one pair when counting towards the k pairs. Your solution should implement the following function: int solution(vector<int> fruits, int k) { // ... your code here } Input: fruits : An array of integers representing the sequence of fruits on the conveyor belt. k : A positive integer representing the minimum number of pairs to count. Output: An integer representing the number of contiguous sections which contain at least k pairs of identical fruits. Execution Time Limit: 0.5 seconds (c