Pyramid Transition Matrix
Input:
bottom = "BCD", allowed = ["BCG", "CDE", "GEA", "FFF"]
Output:
true
Explanation:
We can stack the pyramid like this:
A
/ \
G E
/ \ / \
B C D
We are allowed to place G on top of B and C because BCG is an allowed triple. Similarly, we can place E on top of C and D, then A on top of G and E.Last updated