You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start at the second-to-bottom row of the triangle (row index triangle.length-2), which has n elements
27
+
Add each number to the 2 numbers beneath it, and keep the higher number (add it to a temporary array)
28
+
Make this array the new bottom row of the triangle (at the level of the current row) and repeat the algorithm with the row above it as the new "second-to-bottom row"
29
+
*/
30
+
31
+
for(leti=triangle.length-2;i>=0;i--){
32
+
letnewCurrentRow=[];//array of elements to replace the row above with
0 commit comments