Challenge

Project 1

Given a sequence arr[] of size n, Write a function int equilibrium(int[] arr, int n) that returns an equilibrium index (if any) or -1 if no equilibrium index exists.

A leader in an array is the element of the array that is greatest compared to all the elements residing on the right side of that element. According to this, the rightmost element will always be the leader
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.