Morgan Stanley interview question

DSA - Trees, DP, Backtracking