Please read the new rule regarding the restriction on the use of AI tools. ×

Special Subarray

Revision en1, by TalentnotDefined, 2023-07-13 20:12:59

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 <= N <= 10^5 0 <= arr[i] <= 30

Can anyone tell me approach for this problem?

Tags problem, subarray

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English TalentnotDefined 2023-07-13 21:38:49 4 Tiny change: ' <= 1000\n1 <= N < 5*10^4\n0 <= arr' -> ' <= 1000\n\n1 <= N < 5*10^4\n\n0 <= arr'
en3 English TalentnotDefined 2023-07-13 21:38:35 36 Constraint Updated
en2 English TalentnotDefined 2023-07-13 20:16:33 2 Tiny change: ' <= 10^5\n0 <= arr' -> ' <= 10^5\n\n0 <= arr'
en1 English TalentnotDefined 2023-07-13 20:12:59 363 Initial revision (published)