find pivot index leetcode 724 solution in java