Yelp Interview Question

Asked one algorithm question and solve it with backtracking.