Find Pivot Index Leetcode Solution Java