Problem Brief
Get Computational Equivalents
OA
Developers at Amazon are building a multi-process analysis tool to analyze the computational intensity of the processes. There are n processes and the ithprocess needs process[i] computation resources for completion.
Two processes are considered to be computationally the same if their resource requirements differ by at most m.
Given the array process and an integer m, find the number of pairs of processes that are computationally the same.
Function Description
Complete the function getComputationalEquivalents in the editor.
getComputationalEquivalents takes the following arguments:
int process[n]: the computational resource requirement of the processesint m: the threshold for being computationally the same
1Example 1
Input
process = [7, 10, 13, 11], m = 3
Output
4
Explanation

Hence, the answer is 4 :)
Constraints
Limits and guarantees your solution can rely on.