You are given an integer array arr of size n.
The interval between any two indices i and j is defined as
Return an array of size n where the element at index i is the sum of intervals between i and all other indices j such that arr[i] == arr[j] and i \neq j. If there is no other index with the same value as arr[i], the sum of intervals for index i is
Constraints:
n == arr.length
n
arr[i]
You are given an integer array arr of size n.
The interval between any two indices i and j is defined as
Return an array of size n where the element at index i is the sum of intervals between i and all other indices j such that arr[i] == arr[j] and i \neq j. If there is no other index with the same value as arr[i], the sum of intervals for index i is
Constraints:
n == arr.length
n
arr[i]