Amazon Interview Question

Two medium level question , one one balanced tree, other one on string