Question d’entretien chez Goldman Sachs

Dp on strings and binary tree