Question: You are given a array of integers .Find the maximum number of non-intersecting segments of length 2(two adjacent elements ), such that segments have an
You are given a array of integers .Find the maximum number of non-intersecting segments of length 2(two adjacent elements ), such that segments have an equal sum.
for example,
given A= [10,1,3,1,2,2,1,0,4] there are three non intersecting segments , each whose sum is equal to 4: (1,3), (2,2), (0,4).Another three non-intersecting segments are : (3,1), (2,2),(0,4)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
