give 0indexed integer array num find leftmost middleIndex ie small possible onesA middleIndex index nums0 nums1 numsmiddleindex1 numsmiddleindex1 numsmiddleindex2 numsnumslength1If middleIndex 0 leave sum consider 0 similarly middleindex numslength 1 right sum consider 0return leftmost middleIndex satisfie condition 1 index Example 1input num 23184output 3explanation the sum number index 3 2 3 1 4the sum number index 3 4 4example 2input num 114output 2explanation the sum number index 2 1 1 0the sum number index 2 0example 3input num 25output 1explanation there valid middleindex Constraints1 numslength 1001000 numsi 1000 note this question 724 httpsleetcodecomproblemsfindpivotindex