724. Find Pivot Index
Find Pivot Index - LeetCode 정수 배열 nums가 주어졌을 때, 이 배열의 피벗 인덱스를 계산하세요. 피벗 인덱스는 해당 인덱스를 기준으로 왼쪽의 모든 숫자의 합이 오른쪽의 모든 숫자의 합과 동일한 인덱스를 나타냅니다. 만약 인덱스가 배열의 왼쪽 끝에 있다면, 왼쪽의 합은 0이 됩니다. 이는 배열의 오른쪽 끝에도 적용됩니다. 가장 왼쪽에 있는 피벗 인덱스를 반환하세요. 만약 이러한 인덱스가 없다면 -1을 반환하세요. Given an array of integers nums, calculate the pivot index of this array. The pivot index is the index where the sum of all the numbers strictly to the..
LeetCode
2023. 11. 11. 17:51