Roofpik Interview Question

Backtracking