Subarrays with length solution codechef

Subarrays with length solution codechef You are given an array AA of length NN. Determine the count of subarrays of AA which contain their length as an element. Formally, count the number of pairs (L,R)(L,R) (1≤L≤R≤N)(1≤L≤R≤N) such that: (R−L+1)∈{AL,AL+1,…,AR}(R−L+1)∈{AL,AL+1,…,AR}. Input Format Subarrays with length solution codechef First line will contain TT, number of test cases. Then the test cases follow. First line of each test … Read more