Question d’entretien chez Yelp

Asked one algorithm question and solve it with backtracking.