Company: Coupa
Difficulty: medium
Equal Subarrays Problem Description You are given an array A of size N holding non-negative integers. A subarray of A is any contiguous stretch of the array, i.e., the entries Aᵢ, Aᵢ₊₁, ..., Aⱼ for some 1 ≤ i ≤ j ≤ n. Call a subarray equal when every one of its entries has the same value. Count how many equal subarrays the array A contains in total. Function Description In the provided code snippet, fill in the given equalSubarrayCount(...) method so it returns the total count of equal subarrays of the array A. Write your code beneath the marker “WRITE YOUR LOGIC HERE”. Multiple test cases will run against your submission, so keep the input and output format exactly as given. The starter output variable result defaults to -404, which you're free to overwrite. You may also add or drop other output variables as needed. 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 elements of th