LeetCode75-724-Find-Pivot-Index
🧠 思路总结
找一个下标i,当 i左边的sum = i右边的sum时,返回i,否则返回-1。
解题关键: 数组总和 = 左边 + 当前元素 + 右边 (right = total - left - nums[i])
✅ 代码(Java)
1 | |
LeetCode75-724-Find-Pivot-Index
https://powersixxx.github.io/leetcode-blog/2026/02/06/LeetCode75-724-Find-Pivot-Index/