• + 5 comments

    9 2 3 6 5 4 3 2 2 2

    1,1,2,3,1,1,1,1,1,1 right

    2,1,1,5,4,3,2,1,1,1 left

    find out the max for each reasult

    2,1,2,5,4,3,2,1,1,1

    2+1+2+5+4+3+2+1+1= 20