Question d’entretien chez Amazon

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