leftZero) and ones (rightOne), and a variable to store the maximum score (maxScore).rightOne.maxIndices).n (inclusive), where n is the length of the array.i, calculate the current division score as the sum of leftZero and rightOne.maxScore, update maxScore and reset maxIndices to only contain the current index i.maxScore, append the current index i to maxIndices.leftZero and rightOne based on the value at the current index i.maxIndices as the final result.