Does anyone understand what this question is asking?
I noticed it's one of Airbnb's questions they ask during SE interview.
Problem: given a list of leaf nodes in a pyramid ,and a map which indicates what's the possible parent node given a left and right node. Return true if the one of leaf node could turn into the root node, Otherwise, return false.
Example:
Example:
root
/ \
X X
/\ /\
X X X
/ \/ \/ \
A B C DMap:
left: A | B | C | D
right---------------------------------
A B |A or C| D | A
B D |B or C| A |
C B
DNote:1. If left child is B, right child is A, the parent node could be B or C
I heard it's supposed to be similar to https://leetcode.com/problems/pyramid-transition-matrix/description/