You are given an array arr of size N of non negative integers. Find number of subarrays of array which are special. A subarray is special if product of its maximum and minimum element in divisible by length of the subarray.
Find Number of special Subarrays.
1 <= no of test cases <= 1000
1 <= N < 5*10^4
0 <= arr[i] <= 30
Can anyone tell me approach for this problem?