I'm trying to build a tree from a string. The string is of the form: ((. (.A.E))(.I.O)), where the 5 leaf nodes of the tree are represented with a period.

I'm unable to determine how to solve this problem; I've tried tweaking the solution to a similar problem offered on this website: <https://www.geeksforgeeks.org/construct-binary-tree-string-bracket-representation/>.

Would really appreciate any help you could provide, as I prepare for coding interviews. 

Thanks!