Given an array of integers nums, calculate the pivot index of this array.
The pivot index is the index where the sum of all numbers strictly to the left of the index equals the sum of all numbers strictly to the index's right.
If the index is on the left edge, the left sum is 0 (no elements to the left). Similarly for the right edge.
Return the leftmost pivot index. Return -1 if no such index exists.
Input: nums = [1,7,3,6,5,6]
Output: 3
Explanation: The pivot index is 3. Left sum = 1+7+3 = 11, Right sum = 5+6 = 11.
Input: nums = [1,2,3]
Output: -1
Explanation: No index satisfies the conditions.
Input: nums = [2,1,-1]
Output: 0
Explanation: Pivot index is 0. Left sum = 0, Right sum = 1+(-1) = 0.