How the output is 33?

interview-questions
programming
Tags: #<Tag:0x00007f182c78a208> #<Tag:0x00007f182c789d30>

#1

how output 33 will come? plz tell me.


#2

[(1, 2), 3, 4, 5] cost=3
[(3, 3), 4, 5] cost=6
[6, (4, 5)] cost=9
[(6, 9)] cost=15
Total Cost = 3+6+9+15 = 33
Hope it clears your doubt :slight_smile: