In my question I had following case:

A) if both adjacent side is there then return product of that adjacent side.

For example if balloon is 1 3 5 and we burst 3 then sum is 1 *5=5

B) if only one adjacent side is left then return that adjacent side

Example 1 3, if we burst 1 then sum is 3 and if we burst l3 sum is one.

C) if only one balloon is left the return that

For example 3 then return 3

Please help me in solving in dynamic programming. I could not find any videos on YouTube . I am unable to understand the solution. Please help me