JAVA_Find Pivot Index_LeetCode 724
JAVA_Find Pivot Index_LeetCode 724 풀이 class Solution { public int pivotIndex(int[] nums) { int total = 0, temp = 0; for (int num : nums) total += num; for (int i = 0; i < nums.length; temp += nums[i++]) if (nums[i]==total-2*temp) return i; return -1; } } * 출처 Find Pivot Index - LeetCode Can you solve this real interview question? Find Pivot Index - 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 t