#724 - Find Pivot Index
Given an integer array nums, return the leftmost pivot index. The pivot index is where the sum of all elements strictly to the left equals the sum of all elements strictly to the right. If no such index exists, return -1. An element at the edge has 0 on one side.
| Input | Output |
|---|---|
nums = [1,7,3,6,5,6] | 3 |
nums = [1,2,3] | -1 |
nums = [2,1,-1] | 0 |