Company: Coupa
Difficulty: medium
Equal Subarrays Problem Description An array, A of size N consisting of non-negative integers is given. The subarray of A is a contiguous part of the array A, i.e., the array Aᵢ, Aᵢ₊₁, ..., Aⱼ for some 1 ≤ i ≤ j ≤ n. A subarray is called an equal subarray when all its elements are equal. Find the total number of equal subarrays of the array A. Function Description In the provided code snippet, implement the provided equalSubarrayCount(...) method to find the total number of equal subarrays of the array A. You can write your code in the space below the phrase “WRITE YOUR LOGIC HERE”. There will be multiple test cases running, so the Input and Output should match exactly as provided. The base output variable result is set to a default value of -404 which can be modified. Additionally, you can add or remove these output variables. Input Format The first line contains a single integer N, denoting the length of the array. The second line contains N integers A₁, A₂, ..., Aₙ, denoting the ele