AlgoGenesis / C

AlgoGenesis is a centralized open-source platform dedicated to providing optimized and well-documented algorithm implementations in C. Perfect for both beginners and advanced users, this repository serves as a comprehensive learning resource for solving algorithmic challenges.
MIT License
88 stars 271 forks source link

[NEW ALGORITHM] Equilibrium Index in an Array #1438

Open HUN-sp opened 11 hours ago

HUN-sp commented 11 hours ago

Issue will be closed if:

1) You mention more than one algorithm. You can create a separate issue for each algorithm once the current one is completed.
2) You propose an algorithm that is already present or has been mentioned in a previous issue.
3) You create a new issue without completing your previous issue.

Note: These actions will be taken seriously. Failure to follow the guidelines may result in the immediate closure of your issue.


Name:

[NEW ALGORITHM] Equilibrium Index in an Array

About:

Proposing a new algorithm to find the equilibrium index of an array. The equilibrium index is the position in the array where the sum of elements on the left is equal to the sum of elements on the right.


Detailed Problem Description:

Given an array Arr consisting of N integers, the objective is to find the equilibrium index of the array, where the sum of elements to the left of an index is equal to the sum of elements to the right. If multiple indices satisfy the condition, the left-most index should be returned. If no such index exists, return -1.

Constraints:

Sample Input: 2 6 1 7 3 6 5 6 4 1 2 3 4

Sample Output: 3 -1

Explanation:


Labels:

new algorithm, gssoc-ext, hacktoberfest, level1


Assignees:

HUN-sp commented 11 hours ago

@pankaj-bind I would Like to work on this issue.

github-actions[bot] commented 11 hours ago

👋 Thank you for raising an issue! We appreciate your effort in helping us improve. Our team will review it shortly. Stay tuned!