Microsoft Interview Question

Write a function to calculate the equilibrium index of a given array