You are given two independent interview questions.
Given a triangular array triangle with n rows, find the minimum path sum from the top to the bottom.
triangle[0][0]
.
i
, column
j
, you may move to row
i+1
at column
j
or
j+1
.
Input: A list of lists, where row i has length i+1.
Output: An integer (or numeric) minimum path sum.
Constraints (typical): 1 <= n <= 2000, values may be negative/positive.
There are two fair dice:
{1,2,3,4,5}
(a 5-sided die).
{1,2,3,4,5,6}
(a 6-sided die).
The experiment proceeds in rounds. In each round, you roll both dice once.
1
.
A=1
and
B≠1
.
B=1
and
A≠1
.
A=1
and
B=1
.
Answer the following: