Equilibrium Index Problem

Equilibrium Index Problem — ExecCode Easy DSA Practice

Solve the Equilibrium Index problem on ExecCode. Free online easy DSA practice in Arrays - Logic Building. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given the input needed to solve Equilibrium Index. Your task is to nums: count line then space-separated values. A sequence of values is given, and order matters. In Equilibrium Index, the goal is to transform, count, or select values according to the exact rule. Return equilibrium index or -1.

Examples

Input {"nums": [-7, 1, 5, 2, -4, 3, 0]}; Output 3. Input {"nums": [1, 2, 3]}; Output -1. Input {"nums": [0]}; Output 0

Constraints

1 <= len(nums) <= 10^5

Practice Equilibrium Index free on ExecCode. Browse DSA problems, topic map, and placement guides.