Algorithm · Microsoft · Medium
Two independent tasks follow. Problem 1: Reverse Level Order Traversal A tree node has an integer val and optional left and right child references: Given root, return a list with one inner list per depth level. Inside each inner list, node values must be ordered from left to right. The outer list must be ordered from the deepest level first to the root last. If root is null, return an empty list. Example 1: Explanation: The ordinary level order is [[9],[7,10],[2,8,15]];…
Checking your access…