https://practice.geeksforgeeks.org/problems/construct-tree-1/1