• + 1 comment

    Someone correct me if im mistaken, but the example is wrong when it iterates over element 7 twice. On line where it states 'Remove 6,7, return ' after this there should be no '7' present in the exmple array A. The next line states 'Finaly, remove 8,7 ' but 7 has already been removed in the previous line. so it should read as follows; Remove 6,7, return 6+ 2 * 7 = 20 ans A= 20,16,8 Remove 8,16, return 8+ 2 * 16 = 40 ans A= [40,20] stop as values are above 9, that is still 4 iteration