← Back to all problems
Easy

Find Pivot Index

Updated Feb 24, 2026

Problem

Return index where left sum equals right sum, else -1.

Constraints

1 <= nums.length <= 10^4

Examples

Example 1

Input: {"nums": [1, 7, 3, 6, 5, 6]}
Output: 3

Function Signature

def pivotIndex(self, nums: list[int]) -> int

How to Submit

Implement a Solution class with a pivotIndex method.

Your method will be called with the input parameters and should return the answer.