Triangle

Solution Code

Time Complexity

O(N^2) where N is the number of rows in the triangle.

Space Complexity

O(N) where N is the number of rows in the triangle.