[Solution] Subarrays with length CodeChef Solution | CodeChef Problem Solution 2022
You are given an array of length .
Determine the count of subarrays of which contain their length as an element.
Formally, count the number of pairs such that: .
Solution Click Below:- CLICK HERE
Input Format
- First line will contain , number of test cases. Then the test cases follow.
- First line of each test case contains an integer denoting the length of the array .
- Second line of each test case contains space-separated integers - denoting the array .
Output Format
For each test case, output the count of subarrays containing their lengths.
Constraints
- Sum of over all test cases does not exceed .
No comments:
Post a Comment