@@ -0,0 +1,555 @@
+package array;%0A%0A/**%0A * Created by Yue on 2017/11/22.%0A * leetcode no.724%0A */%0Apublic class FindPivotIndex %7B%0A    public static void main(String%5B%5D args) %7B%0A        int%5B%5D nums = new int%5B%5D %7B-1,-1,-1,-1,0,1%7D;%0A        System.out.println(pivotIndex(nums));%0A    %7D%0A%0A    public static int pivotIndex(int%5B%5D nums) %7B%0A        int left = 0, sum = 0;%0A        for (int i : nums) sum += i;%0A        for (int i = 0; i %3C nums.length; i++) %7B%0A            if (i != 0) left += nums%5Bi - 1%5D;%0A            if (sum - left - nums%5Bi%5D == left) return i;%0A        %7D%0A        return -1;%0A    %7D%0A%7D%0A

add leetcode no.724